asp.net.ph

Type Class

System Namespace


Represents type declarations: class types, interface types, array types, value types, and enumeration types.

Type Class Members

Collapse   Fields

Visibility Name Type
public static Delimiter Char
public static EmptyTypes Type
public static FilterAttribute MemberFilter
public static FilterName MemberFilter
public static FilterNameIgnoreCase MemberFilter
public static Missing Object

Collapse   Properties

Visibility Name Value Type Accessibility
public Assembly Assembly [ Get ]
public AssemblyQualifiedName String [ Get ]
public Attributes TypeAttributes [ Get ]
public BaseType Type [ Get ]
public ContainsGenericParameters Boolean [ Get ]
public DeclaringMethod MethodBase [ Get ]
public DeclaringType Type [ Get ]
public static DefaultBinder Binder [ Get ]
public FullName String [ Get ]
public GenericParameterAttributes GenericParameterAttributes [ Get ]
public GenericParameterPosition Int32 [ Get ]
public GenericTypeArguments Type [ Get ]
public GUID Guid [ Get ]
public HasElementType Boolean [ Get ]
public IsAbstract Boolean [ Get ]
public IsAnsiClass Boolean [ Get ]
public IsArray Boolean [ Get ]
public IsAutoClass Boolean [ Get ]
public IsAutoLayout Boolean [ Get ]
public IsByRef Boolean [ Get ]
public IsClass Boolean [ Get ]
public IsCOMObject Boolean [ Get ]
public IsConstructedGenericType Boolean [ Get ]
public IsContextful Boolean [ Get ]
public IsEnum Boolean [ Get ]
public IsExplicitLayout Boolean [ Get ]
public IsGenericParameter Boolean [ Get ]
public IsGenericType Boolean [ Get ]
public IsGenericTypeDefinition Boolean [ Get ]
public IsImport Boolean [ Get ]
public IsInterface Boolean [ Get ]
public IsLayoutSequential Boolean [ Get ]
public IsMarshalByRef Boolean [ Get ]
public IsNested Boolean [ Get ]
public IsNestedAssembly Boolean [ Get ]
public IsNestedFamANDAssem Boolean [ Get ]
public IsNestedFamily Boolean [ Get ]
public IsNestedFamORAssem Boolean [ Get ]
public IsNestedPrivate Boolean [ Get ]
public IsNestedPublic Boolean [ Get ]
public IsNotPublic Boolean [ Get ]
public IsPointer Boolean [ Get ]
public IsPrimitive Boolean [ Get ]
public IsPublic Boolean [ Get ]
public IsSealed Boolean [ Get ]
public IsSecurityCritical Boolean [ Get ]
public IsSecuritySafeCritical Boolean [ Get ]
public IsSecurityTransparent Boolean [ Get ]
public IsSerializable Boolean [ Get ]
public IsSpecialName Boolean [ Get ]
public IsUnicodeClass Boolean [ Get ]
public IsValueType Boolean [ Get ]
public IsVisible Boolean [ Get ]
public MemberType MemberTypes [ Get ]
public Module Module [ Get ]
public Namespace String [ Get ]
public ReflectedType Type [ Get ]
public StructLayoutAttribute StructLayoutAttribute [ Get ]
public TypeHandle RuntimeTypeHandle [ Get ]
public TypeInitializer ConstructorInfo [ Get ]
public UnderlyingSystemType Type [ Get ]

Collapse   Methods

Visibility Name Parameters Return Type
public Equals ( Object o ) Boolean
public Equals ( Type o ) Boolean
public FindInterfaces ( TypeFilter filter , Object filterCriteria ) Type
public FindMembers ( MemberTypes memberType , BindingFlags bindingAttr , MemberFilter filter , Object filterCriteria ) MemberInfo
public GetArrayRank ( ) Int32
protected GetAttributeFlagsImpl ( ) TypeAttributes
public GetConstructor ( Type types ) ConstructorInfo
public GetConstructor ( BindingFlags bindingAttr , Binder binder , Type types , ParameterModifier modifiers ) ConstructorInfo
public GetConstructor ( BindingFlags bindingAttr , Binder binder , CallingConventions callConvention , Type types , ParameterModifier modifiers ) ConstructorInfo
protected GetConstructorImpl ( BindingFlags bindingAttr , Binder binder , CallingConventions callConvention , Type types , ParameterModifier modifiers ) ConstructorInfo
public GetConstructors ( ) ConstructorInfo
public GetConstructors ( BindingFlags bindingAttr ) ConstructorInfo
public GetDefaultMembers ( ) MemberInfo
public GetElementType ( ) Type
public GetEnumName ( Object value ) String
public GetEnumNames ( ) String
public GetEnumUnderlyingType ( ) Type
public GetEnumValues ( ) Array
public GetEvent ( String name , BindingFlags bindingAttr ) EventInfo
public GetEvent ( String name ) EventInfo
public GetEvents ( ) EventInfo
public GetEvents ( BindingFlags bindingAttr ) EventInfo
public GetField ( String name ) FieldInfo
public GetField ( String name , BindingFlags bindingAttr ) FieldInfo
public GetFields ( BindingFlags bindingAttr ) FieldInfo
public GetFields ( ) FieldInfo
public GetGenericArguments ( ) Type
public GetGenericParameterConstraints ( ) Type
public GetGenericTypeDefinition ( ) Type
public GetHashCode ( ) Int32
public GetInterface ( String name ) Type
public GetInterface ( String name , Boolean ignoreCase ) Type
public GetInterfaceMap ( Type interfaceType ) InterfaceMapping
public GetInterfaces ( ) Type
public GetMember ( String name , BindingFlags bindingAttr ) MemberInfo
public GetMember ( String name , MemberTypes type , BindingFlags bindingAttr ) MemberInfo
public GetMember ( String name ) MemberInfo
public GetMembers ( BindingFlags bindingAttr ) MemberInfo
public GetMembers ( ) MemberInfo
public GetMethod ( String name , BindingFlags bindingAttr , Binder binder , Type types , ParameterModifier modifiers ) MethodInfo
public GetMethod ( String name , Type types , ParameterModifier modifiers ) MethodInfo
public GetMethod ( String name , Type types ) MethodInfo
public GetMethod ( String name ) MethodInfo
public GetMethod ( String name , BindingFlags bindingAttr ) MethodInfo
public GetMethod ( String name , BindingFlags bindingAttr , Binder binder , CallingConventions callConvention , Type types , ParameterModifier modifiers ) MethodInfo
protected GetMethodImpl ( String name , BindingFlags bindingAttr , Binder binder , CallingConventions callConvention , Type types , ParameterModifier modifiers ) MethodInfo
public GetMethods ( ) MethodInfo
public GetMethods ( BindingFlags bindingAttr ) MethodInfo
public GetNestedType ( String name ) Type
public GetNestedType ( String name , BindingFlags bindingAttr ) Type
public GetNestedTypes ( BindingFlags bindingAttr ) Type
public GetNestedTypes ( ) Type
public GetProperties ( BindingFlags bindingAttr ) PropertyInfo
public GetProperties ( ) PropertyInfo
public GetProperty ( String name , Type types ) PropertyInfo
public GetProperty ( String name ) PropertyInfo
public GetProperty ( String name , Type returnType ) PropertyInfo
public GetProperty ( String name , Type returnType , Type types , ParameterModifier modifiers ) PropertyInfo
public GetProperty ( String name , Type returnType , Type types ) PropertyInfo
public GetProperty ( String name , BindingFlags bindingAttr , Binder binder , Type returnType , Type types , ParameterModifier modifiers ) PropertyInfo
public GetProperty ( String name , BindingFlags bindingAttr ) PropertyInfo
protected GetPropertyImpl ( String name , BindingFlags bindingAttr , Binder binder , Type returnType , Type types , ParameterModifier modifiers ) PropertyInfo
public GetType ( ) Type
public static GetType ( String typeName , Func`2 assemblyResolver , Func`4 typeResolver , Boolean throwOnError , Boolean ignoreCase ) Type
public static GetType ( String typeName , Boolean throwOnError ) Type
public static GetType ( String typeName , Func`2 assemblyResolver , Func`4 typeResolver , Boolean throwOnError ) Type
public static GetType ( String typeName ) Type
public static GetType ( String typeName , Func`2 assemblyResolver , Func`4 typeResolver ) Type
public static GetType ( String typeName , Boolean throwOnError , Boolean ignoreCase ) Type
public static GetTypeArray ( Object args ) Type
public static GetTypeCode ( Type type ) TypeCode
protected GetTypeCodeImpl ( ) TypeCode
public static GetTypeFromCLSID ( Guid clsid ) Type
public static GetTypeFromCLSID ( Guid clsid , Boolean throwOnError ) Type
public static GetTypeFromCLSID ( Guid clsid , String server , Boolean throwOnError ) Type
public static GetTypeFromCLSID ( Guid clsid , String server ) Type
public static GetTypeFromHandle ( RuntimeTypeHandle handle ) Type
public static GetTypeFromProgID ( String progID ) Type
public static GetTypeFromProgID ( String progID , Boolean throwOnError ) Type
public static GetTypeFromProgID ( String progID , String server , Boolean throwOnError ) Type
public static GetTypeFromProgID ( String progID , String server ) Type
public static GetTypeHandle ( Object o ) RuntimeTypeHandle
protected HasElementTypeImpl ( ) Boolean
public InvokeMember ( String name , BindingFlags invokeAttr , Binder binder , Object target , Object args , ParameterModifier modifiers , CultureInfo culture , String namedParameters ) Object
public InvokeMember ( String name , BindingFlags invokeAttr , Binder binder , Object target , Object args ) Object
public InvokeMember ( String name , BindingFlags invokeAttr , Binder binder , Object target , Object args , CultureInfo culture ) Object
protected IsArrayImpl ( ) Boolean
public IsAssignableFrom ( Type c ) Boolean
protected IsByRefImpl ( ) Boolean
protected IsCOMObjectImpl ( ) Boolean
protected IsContextfulImpl ( ) Boolean
public IsEnumDefined ( Object value ) Boolean
public IsEquivalentTo ( Type other ) Boolean
public IsInstanceOfType ( Object o ) Boolean
protected IsMarshalByRefImpl ( ) Boolean
protected IsPointerImpl ( ) Boolean
protected IsPrimitiveImpl ( ) Boolean
public IsSubclassOf ( Type c ) Boolean
protected IsValueTypeImpl ( ) Boolean
public MakeArrayType ( Int32 rank ) Type
public MakeArrayType ( ) Type
public MakeByRefType ( ) Type
public MakeGenericType ( Type typeArguments ) Type
public MakePointerType ( ) Type
public static ReflectionOnlyGetType ( String typeName , Boolean throwIfNotFound , Boolean ignoreCase ) Type
public ToString ( ) String

Remarks

Type is the root of all reflection operations and the object that represents a type inside the system. Type is an abstract base class that allows multiple implementations. The system will always provide the derived class RuntimeType. In reflection, all classes beginning with the word Runtime are created only once per object in the system and support comparison operations.

This class is the primary way to access metadata, and it acts as a gateway to the Reflection API. Use the members of Type to get information about a type declaration, such as the constructors, methods, fields, properties, and events of a class, as well as the module and the assembly in which the class is deployed.

A Type object that represents a type is unique; that is, two Type object references refer to the same object if and only if they represent the same type. This allows for the synchronization of multiple static method invocations and for comparison of Type objects through reference comparisons.

A reference to the Type object associated with a type can be obtained in the following ways.

  • The Object.GetType method provided by Object returns a Type object that represents the type of an instance.
  • The static GetType method provided by Type returns a Type object that represents a type specified by its fully qualified name.
  • The GetTypes, GetType, and FindTypes methods provided by Module return Type objects that represent the types defined in a module. The first can be used to obtain an array of Type objects for all of the public and private types defined in a module. ( An instance of Module is obtained through the static GetModule method provided by Module, or through the Module property provided by Type. )
  • The FindInterfaces method returns a filtered list of interface types supported by a class.
  • The GetElementType method returns a Type object that represents the element.
  • The GetInterfaces and GetInterface methods return Type objects representing the interface types supported by a class.
  • The GetTypeArray method returns an array of Type objects representing the types specified by an arbitrary set of objects. The objects are specified with an array of type Object.
  • The GetTypeFromProgID and GetTypeFromCLSID methods are provided for COM interoperability. They return a Type object that represents the type specified by a ProgID or CLSID.
  • GetTypeFromHandle method is provided for interoperability. It returns a Type object that represents the type specified by a class handle.
  • The typeof operator obtains the Type object for a type.

Note on Security: A derived class can access protected members of the calling code's base classes. Also, access is allowed to assembly members of the calling code's assembly. As a rule, if you are allowed access in early bound code, then you are also allowed access in late bound code.

Note on Reflection over Interfaces: Interfaces that extend other interfaces do not inherit the methods defined in the extended interfaces.

See Also

Object   System.Reflection   ReflectionPermission Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph