File: SchemaImporterExtension.xml

package info (click to toggle)
mono 6.12.0.199%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,296,836 kB
  • sloc: cs: 11,181,803; xml: 2,850,076; ansic: 699,709; cpp: 123,344; perl: 59,361; javascript: 30,841; asm: 21,853; makefile: 20,405; sh: 15,009; python: 4,839; pascal: 925; sql: 859; sed: 16; php: 1
file content (269 lines) | stat: -rw-r--r-- 21,457 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
<?xml version="1.0" encoding="utf-8"?>
<Type Name="SchemaImporterExtension" FullName="System.Xml.Serialization.Advanced.SchemaImporterExtension">
  <TypeSignature Language="C#" Value="public abstract class SchemaImporterExtension" />
  <TypeSignature Language="ILAsm" Value=".class public auto ansi abstract beforefieldinit SchemaImporterExtension extends System.Object" />
  <AssemblyInfo>
    <AssemblyName>System.Xml</AssemblyName>
    <AssemblyVersion>2.0.0.0</AssemblyVersion>
    <AssemblyVersion>4.0.0.0</AssemblyVersion>
  </AssemblyInfo>
  <Base>
    <BaseTypeName>System.Object</BaseTypeName>
  </Base>
  <Interfaces />
  <Docs>
    <since version=".NET 2.0" />
    <remarks>
      <attribution license="cc4" from="Microsoft" modified="false" />
      <para>Schema importation occurs whenever a Web service proxy is produced through a tool such as the Add Web Reference dialog box found in Visual Studio, or by using the <format type="text/html"><a href="b9210348-8bc2-4367-8c91-d1a04b403e88">Web Services Description Language Tool (Wsdl.exe)</a></format>. Schema importation also occurs when using the <format type="text/html"><a href="a6e6e65c-347f-4494-9457-653bf29baac2">XML Schema Definition Tool (Xsd.exe)</a></format> to generate code from a specific XSD document. </para>
      <para>The <see cref="T:System.Xml.Serialization.Advanced.SchemaImporterExtension" /> class allows you to modify the code generated when using any of these tools. For example, you may have an existing class that processes book orders on a system and you have an existing XSD document that supplies your orders. Using the <see cref="T:System.Xml.Serialization.Advanced.SchemaImporterExtension" /> class, you can enable one of the tools to generate code that uses your class.</para>
      <para>In order to control the generation of the code, you must use the classes found in the <see cref="N:System.CodeDom" /> namespace. For more information, see <format type="text/html"><a href="0444ddf3-c3f6-44ed-a999-f710d9c3e0cf">Using the CodeDOM</a></format> and <format type="text/html"><a href="c77b8bfd-0a32-4e36-b59a-4f687f32c524">CodeDOM Quick Reference</a></format>.</para>
      <para>The steps to enabling the WSDL.exe tool (which in turn is used by other tools such as the Add Web Reference dialog box) to use your extension are:</para>
      <list type="ordered">
        <item>
          <para>Create an implementation of the <see cref="T:System.Xml.Serialization.Advanced.SchemaImporterExtension" /> class. </para>
        </item>
        <item>
          <para>Use the <see cref="Overload:System.Xml.Serialization.Advanced.SchemaImporterExtension.ImportSchemaType" /> method to write code for the code generator. The method contains parameters that allow you to examine the intercepted XSD type and create CodeDOM objects that are used to generate the new CLR code. </para>
        </item>
        <item>
          <para>If required, use the <see cref="M:System.Xml.Serialization.Advanced.SchemaImporterExtension.ImportAnyElement(System.Xml.Schema.XmlSchemaAny,System.Boolean,System.Xml.Serialization.XmlSchemas,System.Xml.Serialization.XmlSchemaImporter,System.CodeDom.CodeCompileUnit,System.CodeDom.CodeNamespace,System.Xml.Serialization.CodeGenerationOptions,System.CodeDom.Compiler.CodeDomProvider)" /> method to handle &lt;xsd:any&gt; elements found in the XSD document.</para>
        </item>
        <item>
          <para>If required, use the <see cref="M:System.Xml.Serialization.Advanced.SchemaImporterExtension.ImportDefaultValue(System.String,System.String)" /> method to examine default values found in the XSD document and return a different default value. </para>
        </item>
        <item>
          <para>Compile your extension into a library.</para>
        </item>
        <item>
          <para>Sign the assembly.</para>
        </item>
        <item>
          <para>Install the assembly in the Global Assembly Cache (GAC).</para>
        </item>
        <item>
          <para>Modify the machine.config file to include the extension.</para>
        </item>
      </list>
      <para> </para>
    </remarks>
    <summary>
      <attribution license="cc4" from="Microsoft" modified="false" />
      <para>Allows you to customize the code generated from a Web Services Description Language (WSDL) document when using automated query tools.</para>
    </summary>
  </Docs>
  <Members>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="protected SchemaImporterExtension ();" />
      <MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor() cil managed" />
      <MemberType>Constructor</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
        <AssemblyVersion>4.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Parameters />
      <Docs>
        <remarks>To be added.</remarks>
        <since version=".NET 2.0" />
        <summary>
          <attribution license="cc4" from="Microsoft" modified="false" />
          <para>Initializes a new instance of the <see cref="T:System.Xml.Serialization.Advanced.SchemaImporterExtension" /> class. </para>
        </summary>
      </Docs>
    </Member>
    <Member MemberName="ImportAnyElement">
      <MemberSignature Language="C#" Value="public virtual string ImportAnyElement (System.Xml.Schema.XmlSchemaAny any, bool mixed, System.Xml.Serialization.XmlSchemas schemas, System.Xml.Serialization.XmlSchemaImporter importer, System.CodeDom.CodeCompileUnit compileUnit, System.CodeDom.CodeNamespace mainNamespace, System.Xml.Serialization.CodeGenerationOptions options, System.CodeDom.Compiler.CodeDomProvider codeProvider);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string ImportAnyElement(class System.Xml.Schema.XmlSchemaAny any, bool mixed, class System.Xml.Serialization.XmlSchemas schemas, class System.Xml.Serialization.XmlSchemaImporter importer, class System.CodeDom.CodeCompileUnit compileUnit, class System.CodeDom.CodeNamespace mainNamespace, valuetype System.Xml.Serialization.CodeGenerationOptions options, class System.CodeDom.Compiler.CodeDomProvider codeProvider) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
        <AssemblyVersion>4.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.String</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="any" Type="System.Xml.Schema.XmlSchemaAny" />
        <Parameter Name="mixed" Type="System.Boolean" />
        <Parameter Name="schemas" Type="System.Xml.Serialization.XmlSchemas" />
        <Parameter Name="importer" Type="System.Xml.Serialization.XmlSchemaImporter" />
        <Parameter Name="compileUnit" Type="System.CodeDom.CodeCompileUnit" />
        <Parameter Name="mainNamespace" Type="System.CodeDom.CodeNamespace" />
        <Parameter Name="options" Type="System.Xml.Serialization.CodeGenerationOptions" />
        <Parameter Name="codeProvider" Type="System.CodeDom.Compiler.CodeDomProvider" />
      </Parameters>
      <Docs>
        <since version=".NET 2.0" />
        <remarks>
          <attribution license="cc4" from="Microsoft" modified="false" />
          <para>In order to control the generation of the code, you must use the classes found in the <see cref="N:System.CodeDom" /> namespace. For more information, see <format type="text/html"><a href="0444ddf3-c3f6-44ed-a999-f710d9c3e0cf">Using the CodeDOM</a></format> and <format type="text/html"><a href="c77b8bfd-0a32-4e36-b59a-4f687f32c524">CodeDOM Quick Reference</a></format>.</para>
        </remarks>
        <summary>
          <attribution license="cc4" from="Microsoft" modified="false" />
          <para>Handles the importation of the &lt;xsd:any&gt; elements in the schema.</para>
        </summary>
        <returns>
          <attribution license="cc4" from="Microsoft" modified="false" />
          <para>The name of the CLR type that the element maps to. </para>
        </returns>
        <param name="any">
          <attribution license="cc4" from="Microsoft" modified="false" />An <see cref="T:System.Xml.Schema.XmlSchemaAny" /> that represents the xsd:any element found in the XML Schema Document (XSD).</param>
        <param name="mixed">
          <attribution license="cc4" from="Microsoft" modified="false" />A <see cref="T:System.Boolean" /> that indicates whether the XSD complex attribute has been set to "mixed". true, if the attribute has been set to mixed, otherwise false. </param>
        <param name="schemas">
          <attribution license="cc4" from="Microsoft" modified="false" />An <see cref="T:System.Xml.Serialization.XmlSchemas" /> that contains the collection of schemas found in the XSD.</param>
        <param name="importer">
          <attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Xml.Serialization.XmlSchemaImporter" /> that is the importer being used.</param>
        <param name="compileUnit">
          <attribution license="cc4" from="Microsoft" modified="false" />A <see cref="T:System.CodeDom.CodeCompileUnit" /> to which you can add CodeDOM structures to generate alternative code for the XSD. </param>
        <param name="mainNamespace">
          <attribution license="cc4" from="Microsoft" modified="false" />A <see cref="T:System.CodeDom.CodeNamespace" /> that represents the current namespace for the element.</param>
        <param name="options">
          <attribution license="cc4" from="Microsoft" modified="false" />A <see cref="T:System.Xml.Serialization.CodeGenerationOptions" /> for the setting options on the code compiler.</param>
        <param name="codeProvider">
          <attribution license="cc4" from="Microsoft" modified="false" />A <see cref="T:System.CodeDom.Compiler.CodeDomProvider" /> that is the CodeDOM provider used to generate the new code. </param>
      </Docs>
    </Member>
    <Member MemberName="ImportDefaultValue">
      <MemberSignature Language="C#" Value="public virtual System.CodeDom.CodeExpression ImportDefaultValue (string value, string type);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.CodeDom.CodeExpression ImportDefaultValue(string value, string type) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
        <AssemblyVersion>4.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.CodeDom.CodeExpression</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="value" Type="System.String" />
        <Parameter Name="type" Type="System.String" />
      </Parameters>
      <Docs>
        <since version=".NET 2.0" />
        <remarks>
          <attribution license="cc4" from="Microsoft" modified="false" />
          <para>In order to control the generation of the code, you must use the classes found in the <see cref="N:System.CodeDom" /> namespace. For more information, see <format type="text/html"><a href="0444ddf3-c3f6-44ed-a999-f710d9c3e0cf">Using the CodeDOM</a></format> and <format type="text/html"><a href="c77b8bfd-0a32-4e36-b59a-4f687f32c524">CodeDOM Quick Reference</a></format>.</para>
        </remarks>
        <summary>
          <attribution license="cc4" from="Microsoft" modified="false" />
          <para>Allows you to specify the default value for the XSD type being imported.</para>
        </summary>
        <returns>
          <attribution license="cc4" from="Microsoft" modified="false" />
          <para>A <see cref="T:System.CodeDom.CodeExpression" /> setting the new default value.</para>
        </returns>
        <param name="value">
          <attribution license="cc4" from="Microsoft" modified="false" />The value found in the original XSD.</param>
        <param name="type">
          <attribution license="cc4" from="Microsoft" modified="false" />The XSD type name.</param>
      </Docs>
    </Member>
    <Member MemberName="ImportSchemaType">
      <MemberSignature Language="C#" Value="public virtual string ImportSchemaType (System.Xml.Schema.XmlSchemaType type, System.Xml.Schema.XmlSchemaObject context, System.Xml.Serialization.XmlSchemas schemas, System.Xml.Serialization.XmlSchemaImporter importer, System.CodeDom.CodeCompileUnit compileUnit, System.CodeDom.CodeNamespace mainNamespace, System.Xml.Serialization.CodeGenerationOptions options, System.CodeDom.Compiler.CodeDomProvider codeProvider);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string ImportSchemaType(class System.Xml.Schema.XmlSchemaType type, class System.Xml.Schema.XmlSchemaObject context, class System.Xml.Serialization.XmlSchemas schemas, class System.Xml.Serialization.XmlSchemaImporter importer, class System.CodeDom.CodeCompileUnit compileUnit, class System.CodeDom.CodeNamespace mainNamespace, valuetype System.Xml.Serialization.CodeGenerationOptions options, class System.CodeDom.Compiler.CodeDomProvider codeProvider) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
        <AssemblyVersion>4.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.String</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="type" Type="System.Xml.Schema.XmlSchemaType" />
        <Parameter Name="context" Type="System.Xml.Schema.XmlSchemaObject" />
        <Parameter Name="schemas" Type="System.Xml.Serialization.XmlSchemas" />
        <Parameter Name="importer" Type="System.Xml.Serialization.XmlSchemaImporter" />
        <Parameter Name="compileUnit" Type="System.CodeDom.CodeCompileUnit" />
        <Parameter Name="mainNamespace" Type="System.CodeDom.CodeNamespace" />
        <Parameter Name="options" Type="System.Xml.Serialization.CodeGenerationOptions" />
        <Parameter Name="codeProvider" Type="System.CodeDom.Compiler.CodeDomProvider" />
      </Parameters>
      <Docs>
        <remarks>To be added.</remarks>
        <since version=".NET 2.0" />
        <summary>
          <attribution license="cc4" from="Microsoft" modified="false" />
          <para>Allows you to manipulate the code generated by examining the imported schema and specifying the CLR type that it maps to.</para>
        </summary>
        <returns>
          <attribution license="cc4" from="Microsoft" modified="false" />
          <para>The name of the CLR type that this maps to.</para>
        </returns>
        <param name="type">
          <attribution license="cc4" from="Microsoft" modified="false" />An <see cref="T:System.Xml.Schema.XmlSchemaType" /> that represents the XSD type.</param>
        <param name="context">
          <attribution license="cc4" from="Microsoft" modified="false" />An <see cref="T:System.Xml.Schema.XmlSchemaObject" /> that represents schema information, such as the line number of the XML element.</param>
        <param name="schemas">
          <attribution license="cc4" from="Microsoft" modified="false" />An <see cref="T:System.Xml.Serialization.XmlSchemas" /> that contains the collection of schemas in the document.</param>
        <param name="importer">
          <attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Xml.Serialization.XmlSchemaImporter" /> that is the importer being used.</param>
        <param name="compileUnit">
          <attribution license="cc4" from="Microsoft" modified="false" />A <see cref="T:System.CodeDom.CodeCompileUnit" /> to which you can add CodeDOM structures to generate alternative code for the XSD.</param>
        <param name="mainNamespace">
          <attribution license="cc4" from="Microsoft" modified="false" />A <see cref="T:System.CodeDom.CodeNamespace" /> that represents the current namespace for the element.</param>
        <param name="options">
          <attribution license="cc4" from="Microsoft" modified="false" />A <see cref="T:System.Xml.Serialization.CodeGenerationOptions" /> for the setting options on the code compiler.</param>
        <param name="codeProvider">
          <attribution license="cc4" from="Microsoft" modified="false" />A <see cref="T:System.CodeDom.Compiler.CodeDomProvider" /> that is used to generate the new code.</param>
      </Docs>
    </Member>
    <Member MemberName="ImportSchemaType">
      <MemberSignature Language="C#" Value="public virtual string ImportSchemaType (string name, string ns, System.Xml.Schema.XmlSchemaObject context, System.Xml.Serialization.XmlSchemas schemas, System.Xml.Serialization.XmlSchemaImporter importer, System.CodeDom.CodeCompileUnit compileUnit, System.CodeDom.CodeNamespace mainNamespace, System.Xml.Serialization.CodeGenerationOptions options, System.CodeDom.Compiler.CodeDomProvider codeProvider);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string ImportSchemaType(string name, string ns, class System.Xml.Schema.XmlSchemaObject context, class System.Xml.Serialization.XmlSchemas schemas, class System.Xml.Serialization.XmlSchemaImporter importer, class System.CodeDom.CodeCompileUnit compileUnit, class System.CodeDom.CodeNamespace mainNamespace, valuetype System.Xml.Serialization.CodeGenerationOptions options, class System.CodeDom.Compiler.CodeDomProvider codeProvider) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
        <AssemblyVersion>4.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.String</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="name" Type="System.String" />
        <Parameter Name="ns" Type="System.String" />
        <Parameter Name="context" Type="System.Xml.Schema.XmlSchemaObject" />
        <Parameter Name="schemas" Type="System.Xml.Serialization.XmlSchemas" />
        <Parameter Name="importer" Type="System.Xml.Serialization.XmlSchemaImporter" />
        <Parameter Name="compileUnit" Type="System.CodeDom.CodeCompileUnit" />
        <Parameter Name="mainNamespace" Type="System.CodeDom.CodeNamespace" />
        <Parameter Name="options" Type="System.Xml.Serialization.CodeGenerationOptions" />
        <Parameter Name="codeProvider" Type="System.CodeDom.Compiler.CodeDomProvider" />
      </Parameters>
      <Docs>
        <since version=".NET 2.0" />
        <remarks>
          <attribution license="cc4" from="Microsoft" modified="false" />
          <para>In order to control the generation of the code, you must use the classes found in the <see cref="N:System.CodeDom" /> namespace. For more information, see <format type="text/html"><a href="0444ddf3-c3f6-44ed-a999-f710d9c3e0cf">Using the CodeDOM</a></format> and <format type="text/html"><a href="c77b8bfd-0a32-4e36-b59a-4f687f32c524">CodeDOM Quick Reference</a></format>.</para>
        </remarks>
        <summary>
          <attribution license="cc4" from="Microsoft" modified="false" />
          <para>Allows you to manipulate the code generated by examining the imported schema and specifying the CLR type that it maps to.</para>
        </summary>
        <returns>
          <attribution license="cc4" from="Microsoft" modified="false" />
          <para>The name of the CLR type that this maps to.</para>
        </returns>
        <param name="name">
          <attribution license="cc4" from="Microsoft" modified="false" />The name of the element.</param>
        <param name="ns">
          <attribution license="cc4" from="Microsoft" modified="false" />The namespace of the element.</param>
        <param name="context">
          <attribution license="cc4" from="Microsoft" modified="false" />An <see cref="T:System.Xml.Schema.XmlSchemaObject" /> that represents schema information, such as the line number of the XML element.</param>
        <param name="schemas">
          <attribution license="cc4" from="Microsoft" modified="false" />An <see cref="T:System.Xml.Serialization.XmlSchemas" /> that contains the collection of schemas in the document.</param>
        <param name="importer">
          <attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Xml.Serialization.XmlSchemaImporter" /> that is the importer being used.</param>
        <param name="compileUnit">
          <attribution license="cc4" from="Microsoft" modified="false" />A <see cref="T:System.CodeDom.CodeCompileUnit" /> to which you can add CodeDOM structures to generate alternative code for the XSD.</param>
        <param name="mainNamespace">
          <attribution license="cc4" from="Microsoft" modified="false" />A <see cref="T:System.CodeDom.CodeNamespace" /> that represents the current namespace for the element.</param>
        <param name="options">
          <attribution license="cc4" from="Microsoft" modified="false" />A <see cref="T:System.Xml.Serialization.CodeGenerationOptions" /> for the setting options on the code compiler.</param>
        <param name="codeProvider">
          <attribution license="cc4" from="Microsoft" modified="false" />A <see cref="T:System.CodeDom.Compiler.CodeDomProvider" /> that is used to generate the new code.</param>
      </Docs>
    </Member>
  </Members>
</Type>