PostSharp SDK 6.10 / / Class Reference / Post­Sharp.​Sdk.​Code­Model Namespace / Instruction­Block Class / Instruction­Block Methods / Instruction­Block.​Define­Local­Variable Method / Instruction­Block.​Define­Local­Variable Method (IType­Signature, String)

InstructionBlock.DefineLocalVariable Method (ITypeSignature, String)

Creates a new local variable in the current block.

Namespace:  PostSharp.Sdk.CodeModel
Assembly:  PostSharp.Compiler.Engine (in PostSharp.Compiler.Engine.dll) Version: 6.10.14.0 (6.10.14.0)
Syntax
C#
public LocalVariableSymbol DefineLocalVariable(
	ITypeSignature type,
	string name
)

Parameters

type
Type: PostSharp.Sdk.CodeModel.ITypeSignature
Variable type.
name
Type: System.String
Variable name, or null to create a name automatically. The variable name may contain the placeholder {0}. It will be replaced by the local variable ordinal at runtime (useful to create unique names).

Return Value

Type: LocalVariableSymbol
The LocalVariableSymbol referencing the new local variable.
See Also