NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

ModuleBuilder.GetTypeToken (Type)

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;

Parameters

type
The Type object that represents the class type.

Return Value

Returns the TypeToken used to identify the given type within this module.

Exceptions

Exception Type Condition
ArgumentNullException if type is a null reference (in Visual Basic Nothing)
ArgumentException if type is a ByRef

Remarks

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.

See Also

ModuleBuilder Class | ModuleBuilder Members | System.Reflection.Emit Namespace | ModuleBuilder.GetTypeToken Overload List