Export (0) Print
Expand All

TypeBuilder Methods

The methods of the TypeBuilder class are listed here. For a complete list of TypeBuilder class members, see the TypeBuilder Members topic.

Public Methods

public methodAddDeclarativeSecurity Adds declarative security to this type.
public methodAddInterfaceImplementation Adds an interface that this type implements.
public methodCreateType Creates a Type object for the class. After defining fields and methods on the class, CreateType is called in order to load its Type object.
public methodDefineConstructor Adds a new constructor to the class, with the given attributes and signature.
public methodDefineDefaultConstructor Defines the default constructor. The constructor defined here will simply call the default constructor of the parent.
public methodDefineEvent Adds a new event to the class, with the given name, attributes and event type.
public methodDefineField Adds a new field to the class, with the given name, attributes and field type.
public methodDefineInitializedData Defines initialized data field in the .sdata section of the portable executable (PE) file.
public methodDefineMethod Overloaded. Defines a method.
public methodDefineMethodOverride Specifies a given method body that implements a given method declaration.
public methodDefineNestedType Overloaded. Defines a nested type.
public methodDefinePInvokeMethod Overloaded. Defines a PInvoke method.
public methodDefineProperty Adds a new property to the class, with the given name and property signature.
public methodDefineTypeInitializer Defines the initializer for this type.
public methodDefineUninitializedData Defines uninitialized data field in the .sdata section of the portable executable (PE) file.
public methodEquals (inherited from Type) Overloaded. Overridden. Determines if the underlying system type of the current Type is the same as the underlying system type of the specified Object or Type.
public methodFindInterfaces (inherited from Type) Returns an array of Type objects representing a filtered list of interfaces implemented or inherited by the current Type.
public methodFindMembers (inherited from Type) Returns a filtered array of MemberInfo objects of the specified member type.
public methodGetArrayRank (inherited from Type) Gets the number of dimensions in an Array.
public methodGetConstructor (inherited from Type) Overloaded. Gets a specific constructor of the current Type.
public methodGetConstructors Overloaded.
public methodGetCustomAttributes Overloaded. Overridden. Returns the custom attributes defined for this type.
public methodGetDefaultMembers (inherited from Type) Searches for the members defined for the current Type whose DefaultMemberAttribute is set.
public methodGetElementType Overridden. Calling this method always throws NotSupportedException.
public methodGetEvent Overloaded.
public methodGetEvents Overloaded.
public methodGetField Overloaded.
public methodGetFields Overloaded.
public methodGetHashCode (inherited from Type) Overridden. Returns the hash code for this instance.
public methodGetInterface Overloaded.
public methodGetInterfaceMap Overridden. Returns an interface mapping for the requested interface.
public methodGetInterfaces Overridden. Returns an array of all the interfaces implemented on this a class and its base classes.
public methodGetMember Overloaded.
public methodGetMembers Overloaded.
public methodGetMethod (inherited from Type) Overloaded. Gets a specific method of the current Type.
public methodGetMethods Overloaded.
public methodGetNestedType Overloaded.
public methodGetNestedTypes Overloaded.
public methodGetProperties Overloaded.
public methodGetProperty (inherited from Type) Overloaded. Gets a specific property of the current Type.
public methodGetType (inherited from Object) Gets the Type of the current instance.
public methodInvokeMember Overloaded.
public methodIsAssignableFrom Overridden. Determines whether an instance of the current Type can be assigned from an instance of the specified Type.
public methodIsDefined Overridden. Set a custom attribute using a custom attribute builder.
public methodIsInstanceOfType (inherited from Type) Determines whether the specified object is an instance of the current Type.
public methodIsSubclassOf Overridden. Checks if this type is a derived class of the given type c.
public methodSetCustomAttribute Overloaded. Sets a custom attribute.
public methodSetParent Sets the parent of this Type.
public methodToString Overridden. Returns the name of the type excluding the namespace.

Protected Methods

protected methodFinalize (inherited from Object) Overridden. Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.

In C# and C++, finalizers are expressed using destructor syntax.

protected methodGetAttributeFlagsImpl Overridden. Returns the implementation attribute flags.
protected methodGetConstructorImpl Overridden. Searches for a constructor whose parameters match the specified argument types and modifiers, using the specified binding constraints and the specified calling convention.
protected methodGetMethodImpl Overridden. Searches for the specified method whose parameters match the specified argument types and modifiers, using the specified binding constraints and the specified calling convention.
protected methodGetPropertyImpl Overridden. Searches for the specified property whose parameters match the specified argument types and modifiers, using the specified binding constraints.
protected methodHasElementTypeImpl Overridden. Calling this method always throws NotSupportedException.
protected methodIsArrayImpl Overridden. Always returns false.
protected methodIsByRefImpl Overridden. Always returns false.
protected methodIsCOMObjectImpl Overridden. Checks if this type imports a COM type.
protected methodIsContextfulImpl (inherited from Type) Implements the IsContextful property and determines whether the Type can be hosted in a context.
protected methodIsMarshalByRefImpl (inherited from Type) Implements the IsMarshalByRef property and determines whether the Type is marshalled by reference.
protected methodIsPointerImpl Overridden. Always returns false.
protected methodIsPrimitiveImpl Overridden. Always returns false.
protected methodIsValueTypeImpl (inherited from Type) Implements the IsValueType property and determines whether the Type is a value type; that is, not a class or an interface.
protected methodMemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

TypeBuilder Class | System.Reflection.Emit Namespace

Show:
© 2015 Microsoft