C# Class System.Type

Represents type declarations: class types, interface types, array types, value types, and enumeration types.
Inheritance: System.Reflection.MemberInfo
Afficher le fichier Open project: kswoll/WootzJs Class Usage Examples

Méthodes publiques

Свойство Type Description
DefaultBinder Binder
EmptyTypes Type[]

Méthodes publiques

Méthode Description
CreateTypeParameter ( string fullName, JsTypeFunction baseType ) : Type
GetConstructor ( BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type types, ParameterModifier modifiers ) : ConstructorInfo

Searches for a constructor whose parameters match the specified argument types and modifiers, using the specified binding constraints and the specified calling convention.

GetConstructor ( BindingFlags bindingAttr, Binder binder, Type types, ParameterModifier modifiers ) : ConstructorInfo

Searches for a constructor whose parameters match the specified argument types and modifiers, using the specified binding constraints.

GetConstructor ( Type types ) : ConstructorInfo

Searches for a public instance constructor whose parameters match the types in the specified array.

GetConstructors ( ) : ConstructorInfo[]
GetElementType ( ) : Type
GetEnumNames ( ) : string[]
GetEnumValues ( ) : Array
GetEvent ( string name ) : EventInfo
GetEvents ( ) : EventInfo[]
GetField ( string name ) : FieldInfo

Searches for the public field with the specified name.

GetField ( string name, BindingFlags bindingAttr ) : FieldInfo

Searches for the specified field, using the specified binding constraints.

GetFields ( ) : FieldInfo[]

Returns all the public fields of the current T:System.Type.

GetFields ( BindingFlags bindingAttr ) : FieldInfo[]

When overridden in a derived class, searches for the fields defined for the current T:System.Type, using the specified binding constraints.

GetGenericArguments ( ) : Type[]

Returns an array of T:System.Type objects that represent the type arguments of a generic type or the type parameters of a generic type definition.

GetGenericTypeDefinition ( ) : Type

Returns a T:System.Type object that represents a generic type definition from which the current generic type can be constructed.

GetInterfaces ( ) : Type[]

When overridden in a derived class, gets all the interfaces implemented or inherited by the current T:System.Type.

GetMethod ( string name ) : MethodInfo

Searches for the public method with the specified name.

GetMethod ( string name, BindingFlags bindingAttr ) : MethodInfo

Searches for the specified method, using the specified binding constraints.

GetMethod ( string name, Type types ) : MethodInfo

Searches for the specified public method whose parameters match the specified argument types.

GetMethods ( ) : MethodInfo[]
GetProperties ( ) : PropertyInfo[]
GetProperty ( string name ) : PropertyInfo

Searches for the public property with the specified name.

GetProperty ( string name, BindingFlags bindingAttr ) : PropertyInfo

Searches for the specified property, using the specified binding constraints.

GetProperty ( string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type types, ParameterModifier modifiers ) : PropertyInfo

Searches for the specified property whose parameters match the specified argument types and modifiers, using the specified binding constraints.

GetProperty ( string name, Type types ) : PropertyInfo

Searches for the specified public property whose parameters match the specified argument types.

GetProperty ( string name, Type returnType, Type types ) : PropertyInfo

Searches for the specified public property whose parameters match the specified argument types.

GetProperty ( string name, Type returnType, Type types, ParameterModifier modifiers ) : PropertyInfo

Searches for the specified public property whose parameters match the specified argument types and modifiers.

GetType ( string typeName ) : Type
GetTypeFromHandle ( RuntimeTypeHandle typeHandle ) : Type
Init ( string fullName, int flags, JsTypeFunction thisType, JsTypeFunction baseType, JsTypeFunction interfaces, JsTypeFunction typeArguments, FieldInfo fields, MethodInfo methods, ConstructorInfo constructors, PropertyInfo properties, EventInfo events, JsTypeFunction elementType, JsTypeFunction unconstructedType ) : void
IsAssignableFrom ( Type type ) : bool
IsInstanceOfType ( object o ) : bool

Determines whether the specified object is an instance of the current T:System.Type.

MakeArrayType ( ) : Type
MakeArrayType ( int rank ) : Type
MakeGenericType ( ) : Type

Substitutes the elements of an array of types for the type parameters of the current generic type definition and returns a T:System.Type object representing the resulting constructed type.

ToString ( ) : string
Type ( string name, Attribute attributes ) : System.Collections.Generic
_GetTypeFromTypeFunc ( JsTypeFunction typeFunction ) : Type

Méthodes protégées

Méthode Description
GetConstructorImpl ( BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type types, ParameterModifier modifiers ) : ConstructorInfo

When overridden in a derived class, searches for a constructor whose parameters match the specified argument types and modifiers, using the specified binding constraints and the specified calling convention.

GetPropertyImpl ( string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type types, ParameterModifier modifiers ) : PropertyInfo

When overridden in a derived class, searches for the specified property whose parameters match the specified argument types and modifiers, using the specified binding constraints.

Private Methods

Méthode Description
GetGenericTypeArgument ( int index ) : Type
GetGenericTypeArgumentCount ( ) : int
GetInterface ( int index ) : Type
GetInterfaceCount ( ) : int
GetMethodImpl ( string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type types, ParameterModifier modifiers ) : MethodInfo
GetProperty ( string name, BindingFlags bindingAttr, Type returnType ) : PropertyInfo
_GetTypeFromInstance ( JsObject instance ) : Type

Method Details

CreateTypeParameter() public static méthode

public static CreateTypeParameter ( string fullName, JsTypeFunction baseType ) : Type
fullName string
baseType JsTypeFunction
Résultat Type

GetConstructor() public méthode

Searches for a constructor whose parameters match the specified argument types and modifiers, using the specified binding constraints and the specified calling convention.
is null.-or- One of the elements in is null. is multidimensional.-or- is multidimensional.-or- and do not have the same length.
public GetConstructor ( BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type types, ParameterModifier modifiers ) : ConstructorInfo
bindingAttr BindingFlags A bitmask comprised of one or more that specify how the search is conducted.-or- Zero, to return null.
binder Binder An object that defines a set of properties and enables binding, which can involve selection of an overloaded method, coercion of argument types, and invocation of a member through reflection.-or- A null reference (Nothing in Visual Basic), to use the .
callConvention CallingConventions The object that specifies the set of rules to use regarding the order and layout of arguments, how the return value is passed, what registers are used for arguments, and the stack is cleaned up.
types Type An array of objects representing the number, order, and type of the parameters for the constructor to get.-or- An empty array of the type (that is, Type[] types = new Type[0]) to get a constructor that takes no parameters.
modifiers ParameterModifier An array of objects representing the attributes associated with the corresponding element in the array. The default binder does not process this parameter.
Résultat ConstructorInfo

GetConstructor() public méthode

Searches for a constructor whose parameters match the specified argument types and modifiers, using the specified binding constraints.
is null.-or- One of the elements in is null. is multidimensional.-or- is multidimensional.-or- and do not have the same length.
public GetConstructor ( BindingFlags bindingAttr, Binder binder, Type types, ParameterModifier modifiers ) : ConstructorInfo
bindingAttr BindingFlags A bitmask comprised of one or more that specify how the search is conducted.-or- Zero, to return null.
binder Binder An object that defines a set of properties and enables binding, which can involve selection of an overloaded method, coercion of argument types, and invocation of a member through reflection.-or- A null reference (Nothing in Visual Basic), to use the .
types Type An array of objects representing the number, order, and type of the parameters for the constructor to get.-or- An empty array of the type (that is, Type[] types = new Type[0]) to get a constructor that takes no parameters.-or- .
modifiers ParameterModifier An array of objects representing the attributes associated with the corresponding element in the parameter type array. The default binder does not process this parameter.
Résultat ConstructorInfo

GetConstructor() public méthode

Searches for a public instance constructor whose parameters match the types in the specified array.
is null.-or- One of the elements in is null. is multidimensional.
public GetConstructor ( Type types ) : ConstructorInfo
types Type An array of objects representing the number, order, and type of the parameters for the desired constructor.-or- An empty array of objects, to get a constructor that takes no parameters. Such an empty array is provided by the static field .
Résultat ConstructorInfo

GetConstructorImpl() protected méthode

When overridden in a derived class, searches for a constructor whose parameters match the specified argument types and modifiers, using the specified binding constraints and the specified calling convention.
is null.-or- One of the elements in is null. is multidimensional.-or- is multidimensional.-or- and do not have the same length. The current type is a or .
protected GetConstructorImpl ( BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type types, ParameterModifier modifiers ) : ConstructorInfo
bindingAttr BindingFlags A bitmask comprised of one or more that specify how the search is conducted.-or- Zero, to return null.
binder Binder An object that defines a set of properties and enables binding, which can involve selection of an overloaded method, coercion of argument types, and invocation of a member through reflection.-or- A null reference (Nothing in Visual Basic), to use the .
callConvention CallingConventions The object that specifies the set of rules to use regarding the order and layout of arguments, how the return value is passed, what registers are used for arguments, and the stack is cleaned up.
types Type An array of objects representing the number, order, and type of the parameters for the constructor to get.-or- An empty array of the type (that is, Type[] types = new Type[0]) to get a constructor that takes no parameters.
modifiers ParameterModifier An array of objects representing the attributes associated with the corresponding element in the array. The default binder does not process this parameter.
Résultat ConstructorInfo

GetConstructors() public méthode

public GetConstructors ( ) : ConstructorInfo[]
Résultat ConstructorInfo[]

GetElementType() public méthode

public GetElementType ( ) : Type
Résultat Type

GetEnumNames() public méthode

public GetEnumNames ( ) : string[]
Résultat string[]

GetEnumValues() public méthode

public GetEnumValues ( ) : Array
Résultat Array

GetEvent() public méthode

public GetEvent ( string name ) : EventInfo
name string
Résultat EventInfo

GetEvents() public méthode

public GetEvents ( ) : EventInfo[]
Résultat EventInfo[]

GetField() public méthode

Searches for the public field with the specified name.
is null. This object is a whose method has not yet been called.
public GetField ( string name ) : FieldInfo
name string The string containing the name of the data field to get.
Résultat FieldInfo

GetField() public méthode

Searches for the specified field, using the specified binding constraints.
is null.
public GetField ( string name, BindingFlags bindingAttr ) : FieldInfo
name string The string containing the name of the data field to get.
bindingAttr BindingFlags A bitmask comprised of one or more that specify how the search is conducted.-or- Zero, to return null.
Résultat FieldInfo

GetFields() public méthode

Returns all the public fields of the current T:System.Type.
public GetFields ( ) : FieldInfo[]
Résultat FieldInfo[]

GetFields() public méthode

When overridden in a derived class, searches for the fields defined for the current T:System.Type, using the specified binding constraints.
public GetFields ( BindingFlags bindingAttr ) : FieldInfo[]
bindingAttr BindingFlags A bitmask comprised of one or more that specify how the search is conducted.-or- Zero, to return null.
Résultat FieldInfo[]

GetGenericArguments() public méthode

Returns an array of T:System.Type objects that represent the type arguments of a generic type or the type parameters of a generic type definition.
The invoked method is not supported in the base class. Derived classes must provide an implementation.
public GetGenericArguments ( ) : Type[]
Résultat Type[]

GetGenericTypeDefinition() public méthode

Returns a T:System.Type object that represents a generic type definition from which the current generic type can be constructed.
The current type is not a generic type. That is, returns false. The invoked method is not supported in the base class. Derived classes must provide an implementation.
public GetGenericTypeDefinition ( ) : Type
Résultat Type

GetInterfaces() public méthode

When overridden in a derived class, gets all the interfaces implemented or inherited by the current T:System.Type.
A static initializer is invoked and throws an exception.
public GetInterfaces ( ) : Type[]
Résultat Type[]

GetMethod() public méthode

Searches for the public method with the specified name.
More than one method is found with the specified name. is null.
public GetMethod ( string name ) : MethodInfo
name string The string containing the name of the public method to get.
Résultat MethodInfo

GetMethod() public méthode

Searches for the specified method, using the specified binding constraints.
More than one method is found with the specified name and matching the specified binding constraints. is null.
public GetMethod ( string name, BindingFlags bindingAttr ) : MethodInfo
name string The string containing the name of the method to get.
bindingAttr BindingFlags A bitmask comprised of one or more that specify how the search is conducted.-or- Zero, to return null.
Résultat MethodInfo

GetMethod() public méthode

Searches for the specified public method whose parameters match the specified argument types.
More than one method is found with the specified name and specified parameters. is null.-or- is null.-or- One of the elements in is null. is multidimensional.
public GetMethod ( string name, Type types ) : MethodInfo
name string The string containing the name of the public method to get.
types Type An array of objects representing the number, order, and type of the parameters for the method to get.-or- An empty array of objects (as provided by the field) to get a method that takes no parameters.
Résultat MethodInfo

GetMethods() public méthode

public GetMethods ( ) : MethodInfo[]
Résultat MethodInfo[]

GetProperties() public méthode

public GetProperties ( ) : PropertyInfo[]
Résultat PropertyInfo[]

GetProperty() public méthode

Searches for the public property with the specified name.
More than one property is found with the specified name. See Remarks. is null.
public GetProperty ( string name ) : PropertyInfo
name string The string containing the name of the public property to get.
Résultat PropertyInfo

GetProperty() public méthode

Searches for the specified property, using the specified binding constraints.
More than one property is found with the specified name and matching the specified binding constraints. See Remarks. is null.
public GetProperty ( string name, BindingFlags bindingAttr ) : PropertyInfo
name string The string containing the name of the property to get.
bindingAttr BindingFlags A bitmask comprised of one or more that specify how the search is conducted.-or- Zero, to return null.
Résultat PropertyInfo

GetProperty() public méthode

Searches for the specified property whose parameters match the specified argument types and modifiers, using the specified binding constraints.
More than one property is found with the specified name and matching the specified binding constraints. is null.-or- is null. is multidimensional.-or- is multidimensional.-or- and do not have the same length. An element of is null.
public GetProperty ( string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type types, ParameterModifier modifiers ) : PropertyInfo
name string The string containing the name of the property to get.
bindingAttr BindingFlags A bitmask comprised of one or more that specify how the search is conducted.-or- Zero, to return null.
binder Binder An object that defines a set of properties and enables binding, which can involve selection of an overloaded method, coercion of argument types, and invocation of a member through reflection.-or- A null reference (Nothing in Visual Basic), to use the .
returnType Type The return type of the property.
types Type An array of objects representing the number, order, and type of the parameters for the indexed property to get.-or- An empty array of the type (that is, Type[] types = new Type[0]) to get a property that is not indexed.
modifiers ParameterModifier An array of objects representing the attributes associated with the corresponding element in the array. The default binder does not process this parameter.
Résultat PropertyInfo

GetProperty() public méthode

Searches for the specified public property whose parameters match the specified argument types.
More than one property is found with the specified name and matching the specified argument types. is null.-or- is null. is multidimensional. An element of is null.
public GetProperty ( string name, Type types ) : PropertyInfo
name string The string containing the name of the public property to get.
types Type An array of objects representing the number, order, and type of the parameters for the indexed property to get.-or- An empty array of the type (that is, Type[] types = new Type[0]) to get a property that is not indexed.
Résultat PropertyInfo

GetProperty() public méthode

Searches for the specified public property whose parameters match the specified argument types.
More than one property is found with the specified name and matching the specified argument types. is null.-or- is null. is multidimensional. An element of is null.
public GetProperty ( string name, Type returnType, Type types ) : PropertyInfo
name string The string containing the name of the public property to get.
returnType Type The return type of the property.
types Type An array of objects representing the number, order, and type of the parameters for the indexed property to get.-or- An empty array of the type (that is, Type[] types = new Type[0]) to get a property that is not indexed.
Résultat PropertyInfo

GetProperty() public méthode

Searches for the specified public property whose parameters match the specified argument types and modifiers.
More than one property is found with the specified name and matching the specified argument types and modifiers. is null.-or- is null. is multidimensional.-or- is multidimensional.-or- and do not have the same length. An element of is null.
public GetProperty ( string name, Type returnType, Type types, ParameterModifier modifiers ) : PropertyInfo
name string The string containing the name of the public property to get.
returnType Type The return type of the property.
types Type An array of objects representing the number, order, and type of the parameters for the indexed property to get.-or- An empty array of the type (that is, Type[] types = new Type[0]) to get a property that is not indexed.
modifiers ParameterModifier An array of objects representing the attributes associated with the corresponding element in the array. The default binder does not process this parameter.
Résultat PropertyInfo

GetPropertyImpl() protected méthode

When overridden in a derived class, searches for the specified property whose parameters match the specified argument types and modifiers, using the specified binding constraints.
More than one property is found with the specified name and matching the specified binding constraints. is null.-or- is null.-or- One of the elements in is null. is multidimensional.-or- is multidimensional.-or- and do not have the same length. The current type is a , , or .
protected GetPropertyImpl ( string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type types, ParameterModifier modifiers ) : PropertyInfo
name string The string containing the name of the property to get.
bindingAttr BindingFlags A bitmask comprised of one or more that specify how the search is conducted.-or- Zero, to return null.
binder Binder An object that defines a set of properties and enables binding, which can involve selection of an overloaded member, coercion of argument types, and invocation of a member through reflection.-or- A null reference (Nothing in Visual Basic), to use the .
returnType Type The return type of the property.
types Type An array of objects representing the number, order, and type of the parameters for the indexed property to get.-or- An empty array of the type (that is, Type[] types = new Type[0]) to get a property that is not indexed.
modifiers ParameterModifier An array of objects representing the attributes associated with the corresponding element in the array. The default binder does not process this parameter.
Résultat PropertyInfo

GetType() public static méthode

public static GetType ( string typeName ) : Type
typeName string
Résultat Type

GetTypeFromHandle() public static méthode

public static GetTypeFromHandle ( RuntimeTypeHandle typeHandle ) : Type
typeHandle RuntimeTypeHandle
Résultat Type

Init() public méthode

public Init ( string fullName, int flags, JsTypeFunction thisType, JsTypeFunction baseType, JsTypeFunction interfaces, JsTypeFunction typeArguments, FieldInfo fields, MethodInfo methods, ConstructorInfo constructors, PropertyInfo properties, EventInfo events, JsTypeFunction elementType, JsTypeFunction unconstructedType ) : void
fullName string
flags int
thisType JsTypeFunction
baseType JsTypeFunction
interfaces JsTypeFunction
typeArguments JsTypeFunction
fields FieldInfo
methods MethodInfo
constructors ConstructorInfo
properties PropertyInfo
events EventInfo
elementType JsTypeFunction
unconstructedType JsTypeFunction
Résultat void

IsAssignableFrom() public méthode

public IsAssignableFrom ( Type type ) : bool
type Type
Résultat bool

IsInstanceOfType() public méthode

Determines whether the specified object is an instance of the current T:System.Type.
public IsInstanceOfType ( object o ) : bool
o object The object to compare with the current type.
Résultat bool

MakeArrayType() public méthode

public MakeArrayType ( ) : Type
Résultat Type

MakeArrayType() public méthode

public MakeArrayType ( int rank ) : Type
rank int
Résultat Type

MakeGenericType() public méthode

Substitutes the elements of an array of types for the type parameters of the current generic type definition and returns a T:System.Type object representing the resulting constructed type.
The current type does not represent a generic type definition. That is, returns false. is null.-or- Any element of is null. The number of elements in is not the same as the number of type parameters in the current generic type definition.-or- Any element of does not satisfy the constraints specified for the corresponding type parameter of the current generic type. -or- contains an element that is a pointer type ( returns true), a by-ref type ( returns true), or . The invoked method is not supported in the base class. Derived classes must provide an implementation.
public MakeGenericType ( ) : Type
Résultat Type

ToString() public méthode

public ToString ( ) : string
Résultat string

Type() public méthode

public Type ( string name, Attribute attributes ) : System.Collections.Generic
name string
attributes Attribute
Résultat System.Collections.Generic

_GetTypeFromTypeFunc() public static méthode

public static _GetTypeFromTypeFunc ( JsTypeFunction typeFunction ) : Type
typeFunction JsTypeFunction
Résultat Type

Property Details

DefaultBinder public_oe static_oe property

public static Binder DefaultBinder
Résultat Binder

EmptyTypes public_oe static_oe property

public static Type[] EmptyTypes
Résultat Type[]