Repository navigation
Expand file tree
/
Copy pathCodeTypeConstructor.xml
More file actions
74 lines (67 loc) · 3.67 KB
/
Copy pathCodeTypeConstructor.xml
File metadata and controls
74 lines (67 loc) · 3.67 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
<Type Name="CodeTypeConstructor" FullName="System.CodeDom.CodeTypeConstructor">
<TypeSignature Language="C#" Value="public class CodeTypeConstructor : System.CodeDom.CodeMemberMethod" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi serializable beforefieldinit CodeTypeConstructor extends System.CodeDom.CodeMemberMethod" />
<TypeSignature Language="DocId" Value="T:System.CodeDom.CodeTypeConstructor" />
<TypeSignature Language="VB.NET" Value="Public Class CodeTypeConstructor
Inherits CodeMemberMethod" />
<TypeSignature Language="C++ CLI" Value="public ref class CodeTypeConstructor : System::CodeDom::CodeMemberMethod" />
<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.CodeMemberMethod</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute>
<AttributeName>System.Runtime.InteropServices.ClassInterface</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Represents a static constructor for a class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.CodeDom.CodeTypeConstructor> can be used to represent the static constructor for a class. A static constructor is called once when the type is loaded.
> [!NOTE]
> Not all languages support static constructors. Support for static constructors can be checked by calling <xref:System.CodeDom.Compiler.ICodeGenerator.Supports%2A> with the <xref:System.CodeDom.Compiler.GeneratorSupport.StaticConstructors> flag to determine if static constructors are supported by the code generator for a particular language.
## Examples
The following example demonstrates use of a <xref:System.CodeDom.CodeTypeConstructor> to declare a static constructor for a type.
[!code-cpp[CodeTypeConstructorExample#2](~/samples/snippets/cpp/VS_Snippets_CLR/CodeTypeConstructorExample/CPP/codetypeconstructorexample.cpp#2)]
[!code-csharp[CodeTypeConstructorExample#2](~/samples/snippets/csharp/VS_Snippets_CLR/CodeTypeConstructorExample/CS/codetypeconstructorexample.cs#2)]
[!code-vb[CodeTypeConstructorExample#2](~/samples/snippets/visualbasic/VS_Snippets_CLR/CodeTypeConstructorExample/VB/codetypeconstructorexample.vb#2)]
]]></format>
</remarks>
<altmember cref="T:System.CodeDom.CodeConstructor" />
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public CodeTypeConstructor ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.CodeDom.CodeTypeConstructor.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:
 CodeTypeConstructor();" />
<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.CodeTypeConstructor" /> class.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
</Members>
</Type>