System.Reflection.Emit.SignatureHelper Class

Assembly: Mscorlib.dll
Namespace: System.Reflection.Emit
Summary
Provides methods for building signatures.
C# Syntax:
public sealed class SignatureHelper
Thread Safety
Reflection Emit is thread-safe when using assemblies that were created with the AppDomain.DefineDynamicAssembly method with the Boolean parameter isSynchronized set to true.
See also:
System.Reflection.Emit Namespace

System.Reflection.Emit.SignatureHelper Member List:

Public Methods
AddArgument Adds an argument to the signature.
AddSentinel Marks the end of a vararg fixed part. This is only used if the caller is creating a vararg signature call site.
Equals Overridden:
Checks if this instance is equal to the given object.
GetFieldSigHelper Returns a signature helper for a field.
GetHashCode Overridden:
Creates and returns a hash code for this instance.
GetLocalVarSigHelper Returns a signature helper for a local variable.
GetMethodSigHelper Overloaded:
GetMethodSigHelper(Module mod, CallingConvention unmanagedCallConv, Type returnType)

Returns a signature helper for a method given the method's module and an unmanaged calling convention.
GetMethodSigHelper Overloaded:
GetMethodSigHelper(Module mod, CallingConventions callingConvention, Type returnType)

Returns a signature helper for a method given the method's module, calling convention, and return type.
GetMethodSigHelper Overloaded:
GetMethodSigHelper(Module mod, Type returnType, Type[] parameterTypes)

Returns a signature helper for a method, given the method's module, calling convention, return type, and parameter types.
GetPropertySigHelper Returns a signature helper for a property given the property's module, return type, and parameter types.
GetSignature Adds the end token to the signature and marks the signature as finished, so no further tokens can be added.
GetType
(inherited from System.Object)
See base class member description: System.Object.GetType

Derived from System.Object, the primary base class for all objects.
ToString Overridden:
Returns a string representing the signature parameters.
Protected Methods
Finalize
(inherited from System.Object)
See base class member description: System.Object.Finalize

Derived from System.Object, the primary base class for all objects.
MemberwiseClone
(inherited from System.Object)
See base class member description: System.Object.MemberwiseClone

Derived from System.Object, the primary base class for all objects.

Hierarchy:


System.Reflection.Emit.SignatureHelper Member Details

Method: AddArgument(
   Type clsArgument
)
Summary
Adds an argument to the signature.
C# Syntax:
public void AddArgument(
   Type clsArgument
);
Parameters:

clsArgument

The type of the argument.

Exceptions
Exception Type Condition
ArgumentException The signature has already been finished.
Remarks
Takes a type and determines whether it is one of the primitive types or a general class. In the former case, the method adds the appropriate shortcut encoding; otherwise, the method calculates and adds the proper description for the type.

Return to top


Method: AddSentinel()
Summary
Marks the end of a vararg fixed part. This is only used if the caller is creating a vararg signature call site.
C# Syntax:
public void AddSentinel();

Return to top


Overridden Method: Equals(
   object obj
)
Summary
Checks if this instance is equal to the given object.
C# Syntax:
public override bool Equals(
   object obj
);
Parameters:

obj

The object with which this instance should be compared.

Return Value:
true if the given object is a SignatureHelper and represents the same signature; otherwise, false.

Return to top


Method: Finalize()
Inherited
See base class member description: System.Object.Finalize
C# Syntax:
~SignatureHelper();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetFieldSigHelper(
   Module mod
)
Summary
Returns a signature helper for a field.
C# Syntax:
public static SignatureHelper GetFieldSigHelper(
   Module mod
);
Parameters:

mod

The module that contains the field for which the SignatureHelper is requested.

Return Value:
The SignatureHelper object for a field.

Return to top


Overridden Method: GetHashCode()
Summary
Creates and returns a hash code for this instance.
C# Syntax:
public override int GetHashCode();
Return Value:
Returns the hash code based on the name.
Remarks
The hash code is created from the name of this instance, so the return value is the same as if the GetHashCode method were called on the value of the Name property.

Return to top


Method: GetLocalVarSigHelper(
   Module mod
)
Summary
Returns a signature helper for a local variable.
C# Syntax:
public static SignatureHelper GetLocalVarSigHelper(
   Module mod
);
Parameters:

mod

The module that contains the local variable for which the SignatureHelper is requested.

Return Value:
The SignatureHelper object for a local variable.

Return to top


Overloaded Method: GetMethodSigHelper(
   Module mod,
   CallingConvention unmanagedCallConv,
   Type returnType
)
Summary
Returns a signature helper for a method given the method's module and an unmanaged calling convention.
C# Syntax:
public static SignatureHelper GetMethodSigHelper(
   Module mod,
   CallingConvention unmanagedCallConv,
   Type returnType
);
Parameters:

mod

The module that contains the method for which the SignatureHelper is requested.

unmanagedCallConv

The unmanaged calling convention of the method.

returnType

The return type of the method.

Return Value:
The SignatureHelper object for a method.

Return to top


Overloaded Method: GetMethodSigHelper(
   Module mod,
   CallingConventions callingConvention,
   Type returnType
)
Summary
Returns a signature helper for a method given the method's module, calling convention, and return type.
C# Syntax:
public static SignatureHelper GetMethodSigHelper(
   Module mod,
   CallingConventions callingConvention,
   Type returnType
);
Parameters:

mod

The module that contains the method for which the SignatureHelper is requested.

callingConvention

The calling convention of the method.

returnType

The return type of the method.

Return Value:
The SignatureHelper object for a method.

Return to top


Overloaded Method: GetMethodSigHelper(
   Module mod,
   Type returnType,
   Type[] parameterTypes
)
Summary
Returns a signature helper for a method, given the method's module, calling convention, return type, and parameter types.
C# Syntax:
public static SignatureHelper GetMethodSigHelper(
   Module mod,
   Type returnType,
   Type[] parameterTypes
);
Parameters:

mod

The module that contains the method for which the SignatureHelper is requested.

returnType

The return type of the method.

parameterTypes

The types of the parameters of the method.

Return Value:
The SignatureHelper object for a method.

Return to top


Method: GetPropertySigHelper(
   Module mod,
   Type returnType,
   Type[] parameterTypes
)
Summary
Returns a signature helper for a property given the property's module, return type, and parameter types.
C# Syntax:
public static SignatureHelper GetPropertySigHelper(
   Module mod,
   Type returnType,
   Type[] parameterTypes
);
Parameters:

mod

The module that contains the property for which the SignatureHelper is requested.

returnType

The return type of the property.

parameterTypes

The types of the parameters of the property.

Return Value:
The SignatureHelper object for a property.

Return to top


Method: GetSignature()
Summary
Adds the end token to the signature and marks the signature as finished, so no further tokens can be added.
C# Syntax:
public byte[] GetSignature();
Return Value:
Returns a byte array made up of the full signature.

Return to top


Method: GetType()
Inherited
See base class member description: System.Object.GetType
C# Syntax:
public Type GetType();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: MemberwiseClone()
Inherited
See base class member description: System.Object.MemberwiseClone
C# Syntax:
protected object MemberwiseClone();

For more information on members inherited from System.Object click on the link above.

Return to top


Overridden Method: ToString()
Summary
Returns a string representing the signature parameters.
C# Syntax:
public override string ToString();
Return Value:
Returns a string representing the parameters of this signature.

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.