System.Reflection.TypeDelegator Class

Wraps a Type object and delegates methods to that Type.

See Also: TypeDelegator Members


public class TypeDelegator : TypeInfo


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

System.Reflection.TypeDelegator derives from Type and implements most of the properties and methods of Type. For each member it implements, System.Reflection.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 TypeDelegator.typeImpl field.


Some members of System.Reflection.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 erload:System.Reflection.TypeDelegator.GetMethod method is supplied by the overridden TypeDelegator.GetMethodImpl(string, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[]) method. The implementation for inherited properties such as Type.IsPublic and Type.IsNestedAssembly is provided by the overridden TypeDelegator.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.#ctor(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 System.Reflection.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 TypeDelegator.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 System.CodeDom.CodeTypeReference.#ctor(Type) constructor).

The following virtual methods (Overridable methods in Visual Basic) of Type are not implemented by System.Reflection.TypeDelegator: Type.MakeGenericType(Type[]), Type.GetGenericTypeDefinition, Type.GetGenericArguments, Type.GetGenericParameterConstraints, Type.MakeArrayType, Type.MakeByRefType, Type.MakePointerType, Type.GetEnumNames, Type.GetEnumValues, Type.GetEnumUnderlyingType, Type.GetTypeCodeImpl, Type.IsEnumDefined(object), Type.IsEquivalentTo(Type).

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


Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0,,