Returns the token used to identify the specified type within this module.
[Visual Basic] Overloads Public Function GetTypeToken( _ ByVal type As Type _ ) As TypeToken [C#] public TypeToken GetTypeToken( Type type ); [C++] public: TypeToken GetTypeToken( Type* type ); [JScript] public function GetTypeToken( type : Type ) : TypeToken;
Returns the TypeToken used to identify the given type within this module.
Exception Type | Condition |
---|---|
ArgumentNullException | if type is a null reference (in Visual Basic Nothing) |
ArgumentException | if type is a ByRef |
Tokens are used in IL instructions to identify objects. Tokens are relative to the module in which they are contained. For example, the token value for String is likely to be different from module to module. When GetTypeToken is invoked, a reference is added to the module. The reference becomes a permanent part of the module; multiple calls with the same argument have no additional affect.
ModuleBuilder Class | ModuleBuilder Members | System.Reflection.Emit Namespace | ModuleBuilder.GetTypeToken Overload List