Declares a new label.
Assembly: mscorlib (in mscorlib.dll)
'Declaration Public Overridable Function DefineLabel As Label
public virtual Label DefineLabel()
A new label that can be used as a token for branching.
The label is just a token and does not yet represent any particular location within the stream. To set the position of the label within the stream, you must call the MarkLabel method.
The following example demonstrates the use of the DefineLabel method to define three labels. This code is part of a larger example provided for the BeginExceptionBlock method.
' Define labels for branching. The labels can be used immediately in Emit ' calls, but they do not acquire their target locations until the ' MarkLabel(Label) method is called at the location in the program that ' the label applies to. ' Dim succeeded As Label = adderIL.DefineLabel() Dim skipOutputInFinally As Label = adderIL.DefineLabel() Dim skipOutputInCatch As Label = adderIL.DefineLabel()
// Define labels for branching. The labels can be used immediately in Emit // calls, but they do not acquire their target locations until the // MarkLabel(Label) method is called at the location in the program that // the label applies to. // Label succeeded = adderIL.DefineLabel(); Label skipOutputInFinally = adderIL.DefineLabel(); Label skipOutputInCatch = adderIL.DefineLabel();
Supported in: 5, 4, 3
Silverlight for Windows Phone
Supported in: Windows Phone OS 7.1
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.