This documentation is archived and is not being maintained.

TypeDelegator Class

Wraps a Type object and delegates all methods to that Type.

Namespace:  System.Reflection
Assembly:  mscorlib (in mscorlib.dll)

[SerializableAttribute]
[ComVisibleAttribute(true)]
public class TypeDelegator : Type

Derive from this type and only overload those methods you have to provide customization in, plus any members that are required by your program and not already implemented by TypeDelegator.

TypeDelegator derives from System.Type and implements most of the properties and methods of Type. For each member it implements, TypeDelegator automatically delegates to the corresponding member of an internal Type object, which is supplied as an argument to the constructor. This internal Type object is exposed to deriving classes by the protected typeImpl field.

NoteNote:

Some members of TypeDelegator have implementations even though the members themselves are simply inherited from Type. In these cases, the implementation is provided by an overridden protected method that has a name that ends in "Impl". For example, the implementation for all overloads of the GetMethod method is supplied by the overridden GetMethodImpl method. The implementation for inherited properties such as IsPublic and IsNestedAssembly is provided by the overridden GetAttributeFlagsImpl method.

Deriving classes can provide a public constructor that takes a Type object as its parameter and simply passes that object to the TypeDelegator(Type) constructor, or can set the internal Type object in some other way.

If a deriving class uses a member that is not implemented by TypeDelegator, it must override that member and provide an implementation. The simplest implementation is to call the corresponding member on the internal Type object exposed by the typeImpl field, but you can provide any implementation your application requires. It is not necessary to override these members if they are not used by your application or by library functions your application calls (for example, by the CodeTypeReference.CodeTypeReference(Type) constructor).

The following virtual methods (Overridable methods in Visual Basic) of Type are not implemented by TypeDelegator: MakeGenericType, GetGenericTypeDefinition, GetGenericArguments, GetGenericParameterConstraints, MakeArrayType, MakeByRefType, MakePointerType.

The following virtual properties (Overridable properties in Visual Basic) of Type are not implemented by TypeDelegator: IsGenericType, IsGenericTypeDefinition, IsGenericParameter, ContainsGenericParameters, DeclaringMethod, GenericParameterAttributes, GenericParameterPosition.

System.Object
  System.Reflection.MemberInfo
    System.Type
      System.Reflection.TypeDelegator

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
Show: