InstructionEncoder.Switch(Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Starts encoding a switch instruction.
public:
System::Reflection::Metadata::Ecma335::SwitchInstructionEncoder Switch(int branchCount);
public System.Reflection.Metadata.Ecma335.SwitchInstructionEncoder Switch (int branchCount);
member this.Switch : int -> System.Reflection.Metadata.Ecma335.SwitchInstructionEncoder
Public Function Switch (branchCount As Integer) As SwitchInstructionEncoder
Parameters
- branchCount
- Int32
The number of branches the instruction will have.
Returns
A SwitchInstructionEncoder that will be used to emit the labels for the branches.
Exceptions
branchCount
is less than or equal to zero.
Branch(LabelHandle) was not called on the returned value exactly branchCount
times.
Remarks
Before using this InstructionEncoder in any other way, the method Branch(LabelHandle) must be called on the returned value exactly branchCount
times. Failure to do so will throw InvalidOperationException.