LocalBuilder Class
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Represents a local variable within a method or constructor.
Assembly: mscorlib (in mscorlib.dll)
The LocalBuilder type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | IsPinned | Gets a value indicating whether the object referred to by the local variable is pinned in memory. (Overrides LocalVariableInfo::IsPinned.) |
![]() | LocalIndex | Gets the zero-based index of the local variable within the method body. (Overrides LocalVariableInfo::LocalIndex.) |
![]() | LocalType | Gets the type of the local variable. (Overrides LocalVariableInfo::LocalType.) |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | SetLocalSymInfo(String) | Sets the name of this local variable. |
![]() | SetLocalSymInfo(String, Int32, Int32) | Sets the name and lexical scope of this local variable. |
![]() | ToString | Returns a user-readable string that describes the local variable. (Inherited from LocalVariableInfo.) |
A LocalBuilder object can be defined using the DeclareLocal method.
The following example creates a static method (Shared in Visual Basic) named Function1 that returns a string and has a parameter of type Int32. In the body of the method, the code example creates LocalBuilder objects representing two 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.
Note: |
|---|
To run this example, see Building examples that have static TextBlock controls for Windows Phone 8. |



Note: