Repository navigation
Expand file tree
/
Copy pathCodeGotoStatement.xml
More file actions
154 lines (141 loc) · 7.48 KB
/
Copy pathCodeGotoStatement.xml
File metadata and controls
154 lines (141 loc) · 7.48 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
<Type Name="CodeGotoStatement" FullName="System.CodeDom.CodeGotoStatement">
<TypeSignature Language="C#" Value="public class CodeGotoStatement : System.CodeDom.CodeStatement" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi serializable beforefieldinit CodeGotoStatement extends System.CodeDom.CodeStatement" />
<TypeSignature Language="DocId" Value="T:System.CodeDom.CodeGotoStatement" />
<TypeSignature Language="VB.NET" Value="Public Class CodeGotoStatement
Inherits CodeStatement" />
<TypeSignature Language="C++ CLI" Value="public ref class CodeGotoStatement : System::CodeDom::CodeStatement" />
<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.CodeStatement</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 <see langword="goto" /> statement.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.CodeDom.CodeGotoStatement> can be used to represent a `goto` statement, which is used in some languages to redirect program flow to a specified label.
The <xref:System.CodeDom.CodeGotoStatement.Label%2A> property indicates the name of the label at which to continue program execution.
> [!NOTE]
> Not all languages support `goto` statements. Call the <xref:System.CodeDom.Compiler.ICodeGenerator.Supports%2A> method with the <xref:System.CodeDom.Compiler.GeneratorSupport.GotoStatements> flag to determine whether a code generator supports `goto` statements.
## Examples
The following example code demonstrates use of a <xref:System.CodeDom.CodeGotoStatement> and a <xref:System.CodeDom.CodeLabeledStatement> to redirect program flow.
[!code-cpp[CodeGotoStatementExample#2](~/samples/snippets/cpp/VS_Snippets_CLR/CodeGotoStatementExample/CPP/codegotostatementexample.cpp#2)]
[!code-csharp[CodeGotoStatementExample#2](~/samples/snippets/csharp/VS_Snippets_CLR/CodeGotoStatementExample/CS/codegotostatementexample.cs#2)]
[!code-vb[CodeGotoStatementExample#2](~/samples/snippets/visualbasic/VS_Snippets_CLR/CodeGotoStatementExample/VB/codegotostatementexample.vb#2)]
]]></format>
</remarks>
<altmember cref="T:System.CodeDom.CodeLabeledStatement" />
</Docs>
<Members>
<MemberGroup MemberName=".ctor">
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.CodeDom.CodeGotoStatement" /> class.</summary>
</Docs>
</MemberGroup>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public CodeGotoStatement ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.CodeDom.CodeGotoStatement.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:
 CodeGotoStatement();" />
<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.CodeGotoStatement" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If you use this constructor you must also set the <xref:System.CodeDom.CodeGotoStatement.Label%2A> property to indicate the name of the label at which to continue program execution.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public CodeGotoStatement (string label);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string label) cil managed" />
<MemberSignature Language="DocId" Value="M:System.CodeDom.CodeGotoStatement.#ctor(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (label As String)" />
<MemberSignature Language="C++ CLI" Value="public:
 CodeGotoStatement(System::String ^ label);" />
<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>
<Parameter Name="label" Type="System.String" />
</Parameters>
<Docs>
<param name="label">The name of the label at which to continue program execution.</param>
<summary>Initializes a new instance of the <see cref="T:System.CodeDom.CodeGotoStatement" /> class using the specified label name.</summary>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="Label" /> is <see langword="null" />.</exception>
<altmember cref="T:System.CodeDom.CodeLabeledStatement" />
</Docs>
</Member>
<Member MemberName="Label">
<MemberSignature Language="C#" Value="public string Label { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Label" />
<MemberSignature Language="DocId" Value="P:System.CodeDom.CodeGotoStatement.Label" />
<MemberSignature Language="VB.NET" Value="Public Property Label As String" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::String ^ Label { System::String ^ get(); void set(System::String ^ value); };" />
<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.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the name of the label at which to continue program execution.</summary>
<value>A string that indicates the name of the label at which to continue program execution.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property indicates the name of the label at which to continue program execution.
A label can be represented by a <xref:System.CodeDom.CodeLabeledStatement>.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The label cannot be set because <paramref name="value" /> is <see langword="null" /> or an empty string.</exception>
<altmember cref="T:System.CodeDom.CodeLabeledStatement" />
</Docs>
</Member>
</Members>
</Type>