-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathLocalBuilder.xml
More file actions
342 lines (321 loc) · 19.6 KB
/
Copy pathLocalBuilder.xml
File metadata and controls
342 lines (321 loc) · 19.6 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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
<Type Name="LocalBuilder" FullName="System.Reflection.Emit.LocalBuilder">
<TypeSignature Language="C#" Value="public abstract class LocalBuilder : System.Reflection.LocalVariableInfo" FrameworkAlternate="net-10.0;net-11.0;net-9.0" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract beforefieldinit LocalBuilder extends System.Reflection.LocalVariableInfo" FrameworkAlternate="net-10.0;net-11.0;net-9.0" />
<TypeSignature Language="DocId" Value="T:System.Reflection.Emit.LocalBuilder" />
<TypeSignature Language="VB.NET" Value="Public MustInherit Class LocalBuilder
Inherits LocalVariableInfo" FrameworkAlternate="net-10.0;net-11.0;net-9.0" />
<TypeSignature Language="F#" Value="type LocalBuilder = class
 inherit LocalVariableInfo" />
<TypeSignature Language="C++ CLI" Value="public ref class LocalBuilder abstract : System::Reflection::LocalVariableInfo" FrameworkAlternate="net-10.0;net-11.0;net-9.0" />
<TypeSignature Language="C#" Value="public sealed class LocalBuilder : System.Reflection.LocalVariableInfo" FrameworkAlternate="net-5.0;net-6.0;net-7.0;net-8.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit LocalBuilder extends System.Reflection.LocalVariableInfo" FrameworkAlternate="net-5.0;net-6.0;net-7.0;net-8.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class LocalBuilder
Inherits LocalVariableInfo" FrameworkAlternate="net-5.0;net-6.0;net-7.0;net-8.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1" />
<TypeSignature Language="C++ CLI" Value="public ref class LocalBuilder sealed : System::Reflection::LocalVariableInfo" FrameworkAlternate="net-5.0;net-6.0;net-7.0;net-8.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1" />
<AssemblyInfo>
<AssemblyName>System.Reflection.Emit.ILGeneration</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeForwardingChain>
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Reflection.Emit.ILGeneration" ToVersion="10.0.0.0" FrameworkAlternate="net-10.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Reflection.Emit.ILGeneration" ToVersion="11.0.0.0" FrameworkAlternate="net-11.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Reflection.Emit.ILGeneration" ToVersion="5.0.0.0" FrameworkAlternate="net-5.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Reflection.Emit.ILGeneration" ToVersion="6.0.0.0" FrameworkAlternate="net-6.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Reflection.Emit.ILGeneration" ToVersion="7.0.0.0" FrameworkAlternate="net-7.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Reflection.Emit.ILGeneration" ToVersion="8.0.0.0" FrameworkAlternate="net-8.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Reflection.Emit.ILGeneration" ToVersion="9.0.0.0" FrameworkAlternate="net-9.0" />
</TypeForwardingChain>
<Base>
<BaseTypeName>System.Reflection.LocalVariableInfo</BaseTypeName>
</Base>
<Interfaces>
</Interfaces>
<Attributes>
<Attribute FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(0)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(0)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Represents a local variable within a method or constructor.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
A `LocalBuilder` object can be defined using the <xref:System.Reflection.Emit.ILGenerator.DeclareLocal*> method.
## Examples
The following example creates a `static` method (`Shared` in Visual Basic) named `Function1` that returns a string and has a parameter of type <xref:System.Int32>. In the body of the method, the code example creates <xref:System.Reflection.Emit.LocalBuilder> objects representing two local variables, and sets symbol information for the local variables. The method does not do anything significant, but the method body demonstrates storing a parameter to a local variable, storing a literal string to a local variable, and loading a local variable.
:::code language="csharp" source="~/snippets/csharp/System.Reflection.Emit/ILGenerator/DeclareLocal/localbuilder_sample_4.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System.Reflection.Emit/ILGenerator/DeclareLocal/localbuilder_sample_4.vb" id="Snippet1":::
]]></format>
</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected LocalBuilder ();" FrameworkAlternate="net-10.0;net-11.0;net-9.0" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor() cil managed" FrameworkAlternate="net-10.0;net-11.0;net-9.0" />
<MemberSignature Language="DocId" Value="M:System.Reflection.Emit.LocalBuilder.#ctor" FrameworkAlternate="net-10.0;net-11.0;net-9.0" />
<MemberSignature Language="VB.NET" Value="Protected Sub New ()" FrameworkAlternate="net-10.0;net-11.0;net-9.0" />
<MemberSignature Language="C++ CLI" Value="protected:
 LocalBuilder();" FrameworkAlternate="net-10.0;net-11.0;net-9.0" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Reflection.Emit.ILGeneration</AssemblyName>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Reflection.Emit.LocalBuilder" /> class.</summary>
<remarks>This constructor is invoked by derived classes.</remarks>
</Docs>
</Member>
<Member MemberName="IsPinned">
<MemberSignature Language="C#" Value="public override bool IsPinned { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IsPinned" />
<MemberSignature Language="DocId" Value="P:System.Reflection.Emit.LocalBuilder.IsPinned" />
<MemberSignature Language="VB.NET" Value="Public Overrides ReadOnly Property IsPinned As Boolean" />
<MemberSignature Language="F#" Value="member this.IsPinned : bool" Usage="System.Reflection.Emit.LocalBuilder.IsPinned" />
<MemberSignature Language="C++ CLI" Value="public:
 virtual property bool IsPinned { bool get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Reflection.Emit.ILGeneration</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value indicating whether the object referred to by the local variable is pinned in memory.</summary>
<value>
<see langword="true" /> if the object referred to by the local variable is pinned in memory; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
In unsafe code, an object must be pinned before it can be referred to by an unmanaged pointer. While the referenced object is pinned, it cannot be moved by garbage collection.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="LocalIndex">
<MemberSignature Language="C#" Value="public override int LocalIndex { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 LocalIndex" />
<MemberSignature Language="DocId" Value="P:System.Reflection.Emit.LocalBuilder.LocalIndex" />
<MemberSignature Language="VB.NET" Value="Public Overrides ReadOnly Property LocalIndex As Integer" />
<MemberSignature Language="F#" Value="member this.LocalIndex : int" Usage="System.Reflection.Emit.LocalBuilder.LocalIndex" />
<MemberSignature Language="C++ CLI" Value="public:
 virtual property int LocalIndex { int get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Reflection.Emit.ILGeneration</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the zero-based index of the local variable within the method body.</summary>
<value>An integer value that represents the order of declaration of the local variable within the method body.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Index numbers are assigned to local variables in the order in which they are declared or emitted, beginning with zero.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="LocalType">
<MemberSignature Language="C#" Value="public override Type LocalType { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Type LocalType" />
<MemberSignature Language="DocId" Value="P:System.Reflection.Emit.LocalBuilder.LocalType" />
<MemberSignature Language="VB.NET" Value="Public Overrides ReadOnly Property LocalType As Type" />
<MemberSignature Language="F#" Value="member this.LocalType : Type" Usage="System.Reflection.Emit.LocalBuilder.LocalType" />
<MemberSignature Language="C++ CLI" Value="public:
 virtual property Type ^ LocalType { Type ^ get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Reflection.Emit.ILGeneration</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Type</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the type of the local variable.</summary>
<value>The <see cref="T:System.Type" /> of the local variable.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code sample illustrates the use of `LocalType`. This code is part of a larger example for the <xref:System.Reflection.Emit.LocalBuilder> class.
:::code language="csharp" source="~/snippets/csharp/System.Reflection.Emit/ILGenerator/DeclareLocal/localbuilder_sample_4.cs" id="Snippet2":::
:::code language="vb" source="~/snippets/visualbasic/System.Reflection.Emit/ILGenerator/DeclareLocal/localbuilder_sample_4.vb" id="Snippet2":::
]]></format>
</remarks>
</Docs>
</Member>
<MemberGroup MemberName="SetLocalSymInfo">
<Docs>
<summary>Sets the local variable's symbolic information.</summary>
</Docs>
</MemberGroup>
<Member MemberName="SetLocalSymInfo">
<MemberSignature Language="C#" Value="public void SetLocalSymInfo (string name);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetLocalSymInfo(string name) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Reflection.Emit.LocalBuilder.SetLocalSymInfo(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub SetLocalSymInfo (name As String)" />
<MemberSignature Language="F#" Value="member this.SetLocalSymInfo : string -> unit" Usage="localBuilder.SetLocalSymInfo name" />
<MemberSignature Language="C++ CLI" Value="public:
 void SetLocalSymInfo(System::String ^ name);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Reflection.Emit.ILGeneration</AssemblyName>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="name" Type="System.String" Index="0" FrameworkAlternate="net-10.0;net-11.0;net-9.0" />
</Parameters>
<Docs>
<param name="name">The name of the local variable.</param>
<summary>Sets the name of this local variable.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Reflection.Emit.LocalBuilder.SetLocalSymInfo*> method is supported for methods defined in dynamic types. It is not supported for dynamic methods defined using the <xref:System.Reflection.Emit.DynamicMethod> class.
## Examples
The following code sample illustrates the use of the <xref:System.Reflection.Emit.LocalBuilder.SetLocalSymInfo*> method. This code is part of a larger example for the <xref:System.Reflection.Emit.LocalBuilder> class.
:::code language="csharp" source="~/snippets/csharp/System.Reflection.Emit/ILGenerator/DeclareLocal/localbuilder_sample_4.cs" id="Snippet2":::
:::code language="vb" source="~/snippets/visualbasic/System.Reflection.Emit/ILGenerator/DeclareLocal/localbuilder_sample_4.vb" id="Snippet2":::
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">The containing type has been created with <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />.
-or-
There is no symbolic writer defined for the containing module.</exception>
<exception cref="T:System.NotSupportedException">This local is defined in a dynamic method, rather than in a method of a dynamic type.</exception>
<exception cref="T:System.ArgumentNullException">The <paramref name="name" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="SetLocalSymInfoCore">
<MemberSignature Language="C#" Value="protected virtual void SetLocalSymInfoCore (string name);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void SetLocalSymInfoCore(string name) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Reflection.Emit.LocalBuilder.SetLocalSymInfoCore(System.String)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub SetLocalSymInfoCore (name As String)" />
<MemberSignature Language="F#" Value="abstract member SetLocalSymInfoCore : string -> unit
override this.SetLocalSymInfoCore : string -> unit" Usage="localBuilder.SetLocalSymInfoCore name" />
<MemberSignature Language="C++ CLI" Value="protected:
 virtual void SetLocalSymInfoCore(System::String ^ name);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Reflection.Emit.ILGeneration</AssemblyName>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="name" Type="System.String" Index="0" FrameworkAlternate="net-10.0;net-11.0;net-9.0" />
</Parameters>
<Docs>
<param name="name">The name of the local variable.</param>
<summary>When overridden in a derived class, sets the name of this local variable.</summary>
<remarks>To be added.</remarks>
<exception cref="T:System.NotSupportedException">Emitting debug info is not supported.</exception>
<exception cref="T:System.InvalidOperationException">The containing type has been created with CreateType().</exception>
</Docs>
</Member>
</Members>
</Type>