Repository navigation
Expand file tree
/
Copy pathCodeCompileUnit.xml
More file actions
251 lines (225 loc) · 13.7 KB
/
Copy pathCodeCompileUnit.xml
File metadata and controls
251 lines (225 loc) · 13.7 KB
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
<Type Name="CodeCompileUnit" FullName="System.CodeDom.CodeCompileUnit">
<TypeSignature Language="C#" Value="public class CodeCompileUnit : System.CodeDom.CodeObject" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi serializable beforefieldinit CodeCompileUnit extends System.CodeDom.CodeObject" />
<TypeSignature Language="DocId" Value="T:System.CodeDom.CodeCompileUnit" />
<TypeSignature Language="VB.NET" Value="Public Class CodeCompileUnit
Inherits CodeObject" />
<TypeSignature Language="C++ CLI" Value="public ref class CodeCompileUnit : System::CodeDom::CodeObject" />
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.CodeDom</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.CodeDom.CodeObject</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute>
<AttributeName>System.Runtime.InteropServices.ClassInterface</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Provides a container for a CodeDOM program graph.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.CodeDom.CodeCompileUnit> provides a container for a CodeDOM program graph.
<xref:System.CodeDom.CodeCompileUnit> contains a collection that can store <xref:System.CodeDom.CodeNamespace> objects containing CodeDOM source code graphs, along with a collection of assemblies referenced by the project, and a collection of attributes for the project assembly.
A <xref:System.CodeDom.CodeCompileUnit> can be passed to the <xref:System.CodeDom.Compiler.ICodeGenerator.GenerateCodeFromCompileUnit%2A> method of an <xref:System.CodeDom.Compiler.ICodeGenerator> implementation along with other parameters to generate code based on the program graph contained by the compile unit.
> [!NOTE]
> Some languages support only a single namespace that contains a single class in a compile unit.
## Examples
The following code example constructs a <xref:System.CodeDom.CodeCompileUnit> that models the program structure of a simple "Hello World" program. This code example is part of a larger example that also produces code from this model, and is provided for the <xref:System.CodeDom.Compiler.CodeDomProvider> class.
[!code-cpp[CodeDomExample#2](~/samples/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source.cpp#2)]
[!code-csharp[CodeDomExample#2](~/samples/snippets/csharp/VS_Snippets_CLR/CodeDomExample/CS/source.cs#2)]
[!code-vb[CodeDomExample#2](~/samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source.vb#2)]
]]></format>
</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public CodeCompileUnit ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.CodeDom.CodeCompileUnit.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:
 CodeCompileUnit();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.CodeDom</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.CodeDom.CodeCompileUnit" /> class.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="AssemblyCustomAttributes">
<MemberSignature Language="C#" Value="public System.CodeDom.CodeAttributeDeclarationCollection AssemblyCustomAttributes { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.CodeDom.CodeAttributeDeclarationCollection AssemblyCustomAttributes" />
<MemberSignature Language="DocId" Value="P:System.CodeDom.CodeCompileUnit.AssemblyCustomAttributes" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property AssemblyCustomAttributes As CodeAttributeDeclarationCollection" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::CodeDom::CodeAttributeDeclarationCollection ^ AssemblyCustomAttributes { System::CodeDom::CodeAttributeDeclarationCollection ^ get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.CodeDom</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.CodeDom.CodeAttributeDeclarationCollection</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a collection of custom attributes for the generated assembly.</summary>
<value>A <see cref="T:System.CodeDom.CodeAttributeDeclarationCollection" /> that indicates the custom attributes for the generated assembly.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can add and remove <xref:System.CodeDom.CodeAttributeDeclaration> objects representing attributes for the generated assembly from this collection.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="EndDirectives">
<MemberSignature Language="C#" Value="public System.CodeDom.CodeDirectiveCollection EndDirectives { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.CodeDom.CodeDirectiveCollection EndDirectives" />
<MemberSignature Language="DocId" Value="P:System.CodeDom.CodeCompileUnit.EndDirectives" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property EndDirectives As CodeDirectiveCollection" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::CodeDom::CodeDirectiveCollection ^ EndDirectives { System::CodeDom::CodeDirectiveCollection ^ get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.CodeDom</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.CodeDom.CodeDirectiveCollection</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a <see cref="T:System.CodeDom.CodeDirectiveCollection" /> object containing end directives.</summary>
<value>A <see cref="T:System.CodeDom.CodeDirectiveCollection" /> object containing end directives.</value>
<remarks>
<format type="text/markdown"><]
[!code-vb[System.CodeDom.CodeDirectives#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.CodeDom.CodeDirectives/VB/codedirective.vb#3)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Namespaces">
<MemberSignature Language="C#" Value="public System.CodeDom.CodeNamespaceCollection Namespaces { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.CodeDom.CodeNamespaceCollection Namespaces" />
<MemberSignature Language="DocId" Value="P:System.CodeDom.CodeCompileUnit.Namespaces" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Namespaces As CodeNamespaceCollection" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::CodeDom::CodeNamespaceCollection ^ Namespaces { System::CodeDom::CodeNamespaceCollection ^ get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.CodeDom</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.CodeDom.CodeNamespaceCollection</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the collection of namespaces.</summary>
<value>A <see cref="T:System.CodeDom.CodeNamespaceCollection" /> that indicates the namespaces that the compile unit uses.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can add and remove <xref:System.CodeDom.CodeNamespace> objects from this collection. Each object represents a namespace.
> [!NOTE]
> Some languages support only a single namespace that contains a single class in a compile unit.
## Examples
The following code example constructs a <xref:System.CodeDom.CodeCompileUnit> that models the program structure of a simple "Hello World" program. This example is part of a larger example that also produces code from this model, and is provided for the <xref:System.CodeDom.Compiler.CodeDomProvider> class.
[!code-cpp[CodeDomExample#2](~/samples/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source.cpp#2)]
[!code-csharp[CodeDomExample#2](~/samples/snippets/csharp/VS_Snippets_CLR/CodeDomExample/CS/source.cs#2)]
[!code-vb[CodeDomExample#2](~/samples/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source.vb#2)]
]]></format>
</remarks>
<altmember cref="T:System.CodeDom.CodeNamespaceCollection" />
</Docs>
</Member>
<Member MemberName="ReferencedAssemblies">
<MemberSignature Language="C#" Value="public System.Collections.Specialized.StringCollection ReferencedAssemblies { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Specialized.StringCollection ReferencedAssemblies" />
<MemberSignature Language="DocId" Value="P:System.CodeDom.CodeCompileUnit.ReferencedAssemblies" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property ReferencedAssemblies As StringCollection" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Collections::Specialized::StringCollection ^ ReferencedAssemblies { System::Collections::Specialized::StringCollection ^ get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.CodeDom</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Collections.Specialized.StringCollection</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the referenced assemblies.</summary>
<value>A <see cref="T:System.Collections.Specialized.StringCollection" /> that contains the file names of the referenced assemblies.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can add and remove file names from this collection.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="StartDirectives">
<MemberSignature Language="C#" Value="public System.CodeDom.CodeDirectiveCollection StartDirectives { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.CodeDom.CodeDirectiveCollection StartDirectives" />
<MemberSignature Language="DocId" Value="P:System.CodeDom.CodeCompileUnit.StartDirectives" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property StartDirectives As CodeDirectiveCollection" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::CodeDom::CodeDirectiveCollection ^ StartDirectives { System::CodeDom::CodeDirectiveCollection ^ get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.CodeDom</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.CodeDom.CodeDirectiveCollection</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a <see cref="T:System.CodeDom.CodeDirectiveCollection" /> object containing start directives.</summary>
<value>A <see cref="T:System.CodeDom.CodeDirectiveCollection" /> object containing start directives.</value>
<remarks>
<format type="text/markdown"><]
[!code-vb[System.CodeDom.CodeDirectives#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.CodeDom.CodeDirectives/VB/codedirective.vb#2)]
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>