Class RoslynType
Namespace: Neon.Roslyn
Assembly: Neon.Roslyn.dll
Syntax
public class RoslynType : Type
Constructors
RoslynType(ITypeSymbol, MetadataLoadContext, bool)
Declaration
public RoslynType(ITypeSymbol typeSymbol, MetadataLoadContext metadataLoadContext, bool isByRef = false)
Parameters
Type | Name | Description |
---|---|---|
ITypeSymbol | typeSymbol | |
MetadataLoadContext | metadataLoadContext | |
bool | isByRef |
Properties
Assembly
Gets the Assembly in which the type is declared. For generic types, gets the Assembly in which the generic type is defined.
Declaration
public override Assembly Assembly { get; }
Property Value
Type | Description |
---|---|
Assembly | An Assembly instance that describes the assembly containing the current type. For generic types, the instance describes the assembly that contains the generic type definition, not the assembly that creates and uses a particular constructed type. |
Overrides
AssemblyQualifiedName
Gets the assembly-qualified name of the type, which includes the name of the assembly from which this Type object was loaded.
Declaration
public override string AssemblyQualifiedName { get; }
Property Value
Type | Description |
---|---|
string | The assembly-qualified name of the Type, which includes the name of the assembly from which the Type was loaded, or null if the current instance represents a generic type parameter. |
Overrides
BaseType
Gets the type from which the current Type directly inherits.
Declaration
public override Type BaseType { get; }
Property Value
Type | Description |
---|---|
Type | The Type from which the current Type directly inherits, or null if the current |
Overrides
DeclaringType
Gets the type that declares the current nested type or generic type parameter.
Declaration
public override Type DeclaringType { get; }
Property Value
Type | Description |
---|---|
Type | A Type object representing the enclosing type, if the current type is a nested type; or the generic type definition, if the current type is a type parameter of a generic type; or the type that declares the generic method, if the current type is a type parameter of a generic method; otherwise, null. |
Overrides
FullName
Gets the fully qualified name of the type, including its namespace but not its assembly.
Declaration
public override string FullName { get; }
Property Value
Type | Description |
---|---|
string | The fully qualified name of the type, including its namespace but not its assembly; or null if the current instance represents a generic type parameter, an array type, pointer type, or |
Overrides
GUID
Gets the GUID associated with the Type.
Declaration
public override Guid GUID { get; }
Property Value
Type | Description |
---|---|
Guid | The GUID associated with the Type. |
Overrides
IsConstructedGenericType
Gets a value that indicates whether this object represents a constructed generic type. You can create instances of a constructed generic type.
Declaration
public override bool IsConstructedGenericType { get; }
Property Value
Type | Description |
---|---|
bool | true if this object represents a constructed generic type; otherwise, false. |
Overrides
IsEnum
Gets a value indicating whether the current Type represents an enumeration.
Declaration
public override bool IsEnum { get; }
Property Value
Type | Description |
---|---|
bool | true if the current Type represents an enumeration; otherwise, false. |
Overrides
IsGenericParameter
Gets a value indicating whether the current Type represents a type parameter in the definition of a generic type or method.
Declaration
public override bool IsGenericParameter { get; }
Property Value
Type | Description |
---|---|
bool | true if the Type object represents a type parameter of a generic type definition or generic method definition; otherwise, false. |
Overrides
IsGenericType
Gets a value indicating whether the current type is a generic type.
Declaration
public override bool IsGenericType { get; }
Property Value
Type | Description |
---|---|
bool | true if the current type is a generic type; otherwise, false. |
Overrides
IsGenericTypeDefinition
Gets a value indicating whether the current Type represents a generic type definition, from which other generic types can be constructed.
Declaration
public override bool IsGenericTypeDefinition { get; }
Property Value
Type | Description |
---|---|
bool | true if the Type object represents a generic type definition; otherwise, false. |
Overrides
Module
Gets the module (the DLL) in which the current Type is defined.
Declaration
public override Module Module { get; }
Property Value
Type | Description |
---|---|
Module | The module in which the current Type is defined. |
Overrides
Name
Gets the name of the current member.
Declaration
public override string Name { get; }
Property Value
Type | Description |
---|---|
string | A string containing the name of this member. |
Overrides
Namespace
Gets the namespace of the Type.
Declaration
public override string Namespace { get; }
Property Value
Type | Description |
---|---|
string | The namespace of the Type; null if the current instance has no namespace or represents a generic parameter. |
Overrides
TypeSymbol
Declaration
public ITypeSymbol TypeSymbol { get; }
Property Value
Type | Description |
---|---|
ITypeSymbol |
UnderlyingSystemType
Indicates the type provided by the common language runtime that represents this type.
Declaration
public override Type UnderlyingSystemType { get; }
Property Value
Type | Description |
---|---|
Type | The underlying system type for the Type. |
Overrides
Methods
Equals(object)
Determines if the underlying system type of the current Type object is the same as the underlying system type of the specified object.
Declaration
public override bool Equals(object o)
Parameters
Type | Name | Description |
---|---|---|
object | o | The object whose underlying system type is to be compared with the underlying system type of the current Type. For the comparison to succeed, |
Returns
Type | Description |
---|---|
bool | true if the underlying system type of |
Overrides
Equals(Type)
Determines if the underlying system type of the current Type is the same as the underlying system type of the specified Type.
Declaration
public override bool Equals(Type o)
Parameters
Type | Name | Description |
---|---|---|
Type | o | The object whose underlying system type is to be compared with the underlying system type of the current Type. |
Returns
Type | Description |
---|---|
bool | true if the underlying system type of |
Overrides
GetArrayRank()
Gets the number of dimensions in an array.
Declaration
public override int GetArrayRank()
Returns
Type | Description |
---|---|
int | An integer that contains the number of dimensions in the current type. |
Overrides
Exceptions
Type | Condition |
---|---|
NotSupportedException | The functionality of this method is unsupported in the base class and must be implemented in a derived class instead. |
ArgumentException | The current type is not an array. |
GetAttributeFlagsImpl()
When overridden in a derived class, implements the Attributes property and gets a bitwise combination of enumeration values that indicate the attributes associated with the Type.
Declaration
protected override TypeAttributes GetAttributeFlagsImpl()
Returns
Type | Description |
---|---|
TypeAttributes | A TypeAttributes object representing the attribute set of the Type. |
Overrides
GetConstructorImpl(BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])
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.
Declaration
protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
Parameters
Type | Name | Description |
---|---|---|
BindingFlags | bindingAttr | A bitwise combination of the enumeration values that specify how the search is conducted. -or- |
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 ( |
CallingConventions | callConvention | 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. |
Type[] | types | An array of Type objects representing the number, order, and type of the parameters for the constructor to get. -or- An empty array of the type Type (that is, Type[] types = new Type[0]) to get a constructor that takes no parameters. |
ParameterModifier[] | modifiers | An array of ParameterModifier objects representing the attributes associated with the corresponding element in the |
Returns
Type | Description |
---|---|
ConstructorInfo | A ConstructorInfo object representing the constructor that matches the specified requirements, if found; otherwise, null. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
-or- One of the elements in |
ArgumentException |
-or-
-or-
|
NotSupportedException | The current type is a TypeBuilder or GenericTypeParameterBuilder. |
GetConstructors(BindingFlags)
When overridden in a derived class, searches for the constructors defined for the current Type, using the specified BindingFlags
.
Declaration
public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr)
Parameters
Type | Name | Description |
---|---|---|
BindingFlags | bindingAttr | A bitwise combination of the enumeration values that specify how the search is conducted. -or- Default to return an empty array. |
Returns
Type | Description |
---|---|
ConstructorInfo[] | An array of ConstructorInfo objects representing all constructors defined for the current Type that match the specified binding constraints, including the type initializer if it is defined. Returns an empty array of type ConstructorInfo if no constructors are defined for the current Type, if none of the defined constructors match the binding constraints, or if the current Type represents a type parameter in the definition of a generic type or generic method. |
Overrides
GetCustomAttributes(bool)
When overridden in a derived class, returns an array of all custom attributes applied to this member.
Declaration
public override object[] GetCustomAttributes(bool inherit)
Parameters
Type | Name | Description |
---|---|---|
bool | inherit | true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events. |
Returns
Type | Description |
---|---|
object[] | An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined. |
Overrides
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This member belongs to a type that is loaded into the reflection-only context. See How to: Load Assemblies into the Reflection-Only Context. |
TypeLoadException | A custom attribute type could not be loaded. |
GetCustomAttributes(Type, bool)
When overridden in a derived class, returns an array of custom attributes applied to this member and identified by Type.
Declaration
public override object[] GetCustomAttributes(Type attributeType, bool inherit)
Parameters
Type | Name | Description |
---|---|---|
Type | attributeType | The type of attribute to search for. Only attributes that are assignable to this type are returned. |
bool | inherit | true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events. |
Returns
Type | Description |
---|---|
object[] | An array of custom attributes applied to this member, or an array with zero elements if no attributes assignable to |
Overrides
Exceptions
Type | Condition |
---|---|
TypeLoadException | A custom attribute type cannot be loaded. |
ArgumentNullException | If |
InvalidOperationException | This member belongs to a type that is loaded into the reflection-only context. See How to: Load Assemblies into the Reflection-Only Context. |
GetCustomAttributesData()
Returns a list of CustomAttributeData objects representing data about the attributes that have been applied to the target member.
Declaration
public override IList<CustomAttributeData> GetCustomAttributesData()
Returns
Type | Description |
---|---|
IList<CustomAttributeData> | A generic list of CustomAttributeData objects representing data about the attributes that have been applied to the target member. |
Overrides
GetElementType()
When overridden in a derived class, returns the Type of the object encompassed or referred to by the current array, pointer or reference type.
Declaration
public override Type GetElementType()
Returns
Type | Description |
---|---|
Type | The Type of the object encompassed or referred to by the current array, pointer, or reference type, or null if the current Type is not an array or a pointer, or is not passed by reference, or represents a generic type or a type parameter in the definition of a generic type or generic method. |
Overrides
GetEvent(string, BindingFlags)
When overridden in a derived class, returns the EventInfo object representing the specified event, using the specified binding constraints.
Declaration
public override EventInfo GetEvent(string name, BindingFlags bindingAttr)
Parameters
Type | Name | Description |
---|---|---|
string | name | The string containing the name of an event which is declared or inherited by the current Type. |
BindingFlags | bindingAttr | A bitwise combination of the enumeration values that specify how the search is conducted. -or- |
Returns
Type | Description |
---|---|
EventInfo | The object representing the specified event that is declared or inherited by the current Type, if found; otherwise, null. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
GetEvents(BindingFlags)
When overridden in a derived class, searches for events that are declared or inherited by the current Type, using the specified binding constraints.
Declaration
public override EventInfo[] GetEvents(BindingFlags bindingAttr)
Parameters
Type | Name | Description |
---|---|---|
BindingFlags | bindingAttr | A bitwise combination of the enumeration values that specify how the search is conducted. -or- Default to return an empty array. |
Returns
Type | Description |
---|---|
EventInfo[] | An array of EventInfo objects representing all events that are declared or inherited by the current Type that match the specified binding constraints. -or- An empty array of type EventInfo, if the current Type does not have events, or if none of the events match the binding constraints. |
Overrides
GetField(string, BindingFlags)
Searches for the specified field, using the specified binding constraints.
Declaration
public override FieldInfo GetField(string name, BindingFlags bindingAttr)
Parameters
Type | Name | Description |
---|---|---|
string | name | The string containing the name of the data field to get. |
BindingFlags | bindingAttr | A bitwise combination of the enumeration values that specify how the search is conducted. -or- |
Returns
Type | Description |
---|---|
FieldInfo | An object representing the field that matches the specified requirements, if found; otherwise, null. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
GetFields(BindingFlags)
When overridden in a derived class, searches for the fields defined for the current Type, using the specified binding constraints.
Declaration
public override FieldInfo[] GetFields(BindingFlags bindingAttr)
Parameters
Type | Name | Description |
---|---|---|
BindingFlags | bindingAttr | A bitwise combination of the enumeration values that specify how the search is conducted. -or- Default to return an empty array. |
Returns
Type | Description |
---|---|
FieldInfo[] | An array of FieldInfo objects representing all fields defined for the current Type that match the specified binding constraints. -or- An empty array of type FieldInfo, if no fields are defined for the current Type, or if none of the defined fields match the binding constraints. |
Overrides
GetGenericArguments()
Returns an array of Type objects that represent the type arguments of a closed generic type or the type parameters of a generic type definition.
Declaration
public override Type[] GetGenericArguments()
Returns
Type | Description |
---|---|
Type[] | An array of Type objects that represent the type arguments of a generic type. Returns an empty array if the current type is not a generic type. |
Overrides
Exceptions
Type | Condition |
---|---|
NotSupportedException | The invoked method is not supported in the base class. Derived classes must provide an implementation. |
GetGenericTypeDefinition()
Returns a Type object that represents a generic type definition from which the current generic type can be constructed.
Declaration
public override Type GetGenericTypeDefinition()
Returns
Type | Description |
---|---|
Type | A Type object representing a generic type from which the current type can be constructed. |
Overrides
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The current type is not a generic type. That is, IsGenericType returns false. |
NotSupportedException | The invoked method is not supported in the base class. Derived classes must provide an implementation. |
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | The hash code for this instance. |
Overrides
GetInterface(string, bool)
When overridden in a derived class, searches for the specified interface, specifying whether to do a case-insensitive search for the interface name.
Declaration
public override Type GetInterface(string name, bool ignoreCase)
Parameters
Type | Name | Description |
---|---|---|
string | name | The string containing the name of the interface to get. For generic interfaces, this is the mangled name. |
bool | ignoreCase | true to ignore the case of that part of -or- false to perform a case-sensitive search for all parts of |
Returns
Type | Description |
---|---|
Type | An object representing the interface with the specified name, implemented or inherited by the current Type, if found; otherwise, null. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
AmbiguousMatchException | The current Type represents a type that implements the same generic interface with different type arguments. |
GetInterfaces()
When overridden in a derived class, gets all the interfaces implemented or inherited by the current Type.
Declaration
public override Type[] GetInterfaces()
Returns
Type | Description |
---|---|
Type[] | An array of Type objects representing all the interfaces implemented or inherited by the current Type. -or- An empty array of type Type, if no interfaces are implemented or inherited by the current Type. |
Overrides
Exceptions
Type | Condition |
---|---|
TargetInvocationException | A static initializer is invoked and throws an exception. |
GetMembers(BindingFlags)
When overridden in a derived class, searches for the members defined for the current Type, using the specified binding constraints.
Declaration
public override MemberInfo[] GetMembers(BindingFlags bindingAttr)
Parameters
Type | Name | Description |
---|---|---|
BindingFlags | bindingAttr | A bitwise combination of the enumeration values that specify how the search is conducted. -or- Default to return an empty array. |
Returns
Type | Description |
---|---|
MemberInfo[] | An array of MemberInfo objects representing all members defined for the current Type that match the specified binding constraints. -or- An empty array if no members are defined for the current Type, or if none of the defined members match the binding constraints. |
Overrides
GetMethodImpl(string, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])
When overridden in a derived class, searches for the specified method whose parameters match the specified argument types and modifiers, using the specified binding constraints and the specified calling convention.
Declaration
protected override MethodInfo GetMethodImpl(string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
Parameters
Type | Name | Description |
---|---|---|
string | name | The string containing the name of the method to get. |
BindingFlags | bindingAttr | A bitwise combination of the enumeration values that specify how the search is conducted. -or- |
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 ( |
CallingConventions | callConvention | 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 what process cleans up the stack. |
Type[] | types | An array of Type objects representing the number, order, and type of the parameters for the method to get. -or- An empty array of the type Type (that is, Type[] types = new Type[0]) to get a method that takes no parameters. -or- |
ParameterModifier[] | modifiers | An array of ParameterModifier objects representing the attributes associated with the corresponding element in the |
Returns
Type | Description |
---|---|
MethodInfo | An object representing the method that matches the specified requirements, if found; otherwise, null. |
Overrides
Exceptions
Type | Condition |
---|---|
AmbiguousMatchException | More than one method is found with the specified name and matching the specified binding constraints. |
ArgumentNullException |
|
ArgumentException |
-or-
-or-
|
NotSupportedException | The current type is a TypeBuilder or GenericTypeParameterBuilder. |
GetMethods(BindingFlags)
When overridden in a derived class, searches for the methods defined for the current Type, using the specified binding constraints.
Declaration
public override MethodInfo[] GetMethods(BindingFlags bindingAttr)
Parameters
Type | Name | Description |
---|---|---|
BindingFlags | bindingAttr | A bitwise combination of the enumeration values that specify how the search is conducted. -or- Default to return an empty array. |
Returns
Type | Description |
---|---|
MethodInfo[] | An array of MethodInfo objects representing all methods defined for the current Type that match the specified binding constraints. -or- An empty array of type MethodInfo, if no methods are defined for the current Type, or if none of the defined methods match the binding constraints. |
Overrides
GetNestedType(string, BindingFlags)
When overridden in a derived class, searches for the specified nested type, using the specified binding constraints.
Declaration
public override Type GetNestedType(string name, BindingFlags bindingAttr)
Parameters
Type | Name | Description |
---|---|---|
string | name | The string containing the name of the nested type to get. |
BindingFlags | bindingAttr | A bitwise combination of the enumeration values that specify how the search is conducted. -or- |
Returns
Type | Description |
---|---|
Type | An object representing the nested type that matches the specified requirements, if found; otherwise, null. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
GetNestedTypes(BindingFlags)
When overridden in a derived class, searches for the types nested in the current Type, using the specified binding constraints.
Declaration
public override Type[] GetNestedTypes(BindingFlags bindingAttr)
Parameters
Type | Name | Description |
---|---|---|
BindingFlags | bindingAttr | A bitwise combination of the enumeration values that specify how the search is conducted. -or- |
Returns
Type | Description |
---|---|
Type[] | An array of Type objects representing all the types nested in the current Type that match the specified binding constraints (the search is not recursive), or an empty array of type Type, if no nested types are found that match the binding constraints. |
Overrides
GetProperties(BindingFlags)
When overridden in a derived class, searches for the properties of the current Type, using the specified binding constraints.
Declaration
public override PropertyInfo[] GetProperties(BindingFlags bindingAttr)
Parameters
Type | Name | Description |
---|---|---|
BindingFlags | bindingAttr | A bitwise combination of the enumeration values that specify how the search is conducted. -or- Default to return an empty array. |
Returns
Type | Description |
---|---|
PropertyInfo[] | An array of objects representing all properties of the current Type that match the specified binding constraints. -or- An empty array of type PropertyInfo, if the current Type does not have properties, or if none of the properties match the binding constraints. |
Overrides
GetPropertyImpl(string, BindingFlags, Binder, Type, Type[], ParameterModifier[])
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.
Declaration
protected override PropertyInfo GetPropertyImpl(string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
Parameters
Type | Name | Description |
---|---|---|
string | name | The string containing the name of the property to get. |
BindingFlags | bindingAttr | A bitwise combination of the enumeration values that specify how the search is conducted. -or- |
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 ( |
Type | returnType | The return type of the property. |
Type[] | types | An array of Type objects representing the number, order, and type of the parameters for the indexed property to get. -or- An empty array of the type Type (that is, Type[] types = new Type[0]) to get a property that is not indexed. |
ParameterModifier[] | modifiers | An array of ParameterModifier objects representing the attributes associated with the corresponding element in the |
Returns
Type | Description |
---|---|
PropertyInfo | An object representing the property that matches the specified requirements, if found; otherwise, null. |
Overrides
Exceptions
Type | Condition |
---|---|
AmbiguousMatchException | More than one property is found with the specified name and matching the specified binding constraints. |
ArgumentNullException |
-or-
-or- One of the elements in |
ArgumentException |
-or-
-or-
|
NotSupportedException | The current type is a TypeBuilder, EnumBuilder, or GenericTypeParameterBuilder. |
HasElementTypeImpl()
When overridden in a derived class, implements the HasElementType property and determines whether the current Type encompasses or refers to another type; that is, whether the current Type is an array, a pointer, or is passed by reference.
Declaration
protected override bool HasElementTypeImpl()
Returns
Type | Description |
---|---|
bool | true if the Type is an array, a pointer, or is passed by reference; otherwise, false. |
Overrides
InvokeMember(string, BindingFlags, Binder, object, object[], ParameterModifier[], CultureInfo, string[])
When overridden in a derived class, invokes the specified member, using the specified binding constraints and matching the specified argument list, modifiers and culture.
Declaration
public override object InvokeMember(string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters)
Parameters
Type | Name | Description |
---|---|---|
string | name | The string containing the name of the constructor, method, property, or field member to invoke. -or- An empty string ("") to invoke the default member. -or- For |
BindingFlags | invokeAttr | A bitwise combination of the enumeration values that specify how the search is conducted. The access can be one of the |
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 DefaultBinder. Note that explicitly defining a Binder object may be required for successfully invoking method overloads with variable arguments. |
object | target | The object on which to invoke the specified member. |
object[] | args | An array containing the arguments to pass to the member to invoke. |
ParameterModifier[] | modifiers | An array of ParameterModifier objects representing the attributes associated with the corresponding element in the The default binder processes this parameter only when calling a COM component. |
CultureInfo | culture | The CultureInfo object representing the globalization locale to use, which may be necessary for locale-specific conversions, such as converting a numeric String to a Double. -or- A null reference ( |
string[] | namedParameters | An array containing the names of the parameters to which the values in the |
Returns
Type | Description |
---|---|
object | An object representing the return value of the invoked member. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentException |
-or-
-or-
-or-
-or-
-or-
-or-
-or-
-or- The named parameter array is larger than the argument array. -or- This method is called on a COM object and one of the following binding flags was not passed in: -or- One of the named parameter arrays contains a string that is null. |
MethodAccessException | The specified member is a class initializer. |
MissingFieldException | The field or property cannot be found. |
MissingMethodException | No method can be found that matches the arguments in -or- No member can be found that has the argument names supplied in -or- The current Type object represents a type that contains open type parameters, that is, ContainsGenericParameters returns true. |
TargetException | The specified member cannot be invoked on |
AmbiguousMatchException | More than one method matches the binding criteria. |
InvalidOperationException | The method represented by |
IsArrayImpl()
When overridden in a derived class, implements the IsArray property and determines whether the Type is an array.
Declaration
protected override bool IsArrayImpl()
Returns
Type | Description |
---|---|
bool |
Overrides
IsAssignableFrom(Type)
Determines whether an instance of a specified type c
can be assigned to a variable of the current type.
Declaration
public override bool IsAssignableFrom(Type c)
Parameters
Type | Name | Description |
---|---|---|
Type | c | The type to compare with the current type. |
Returns
Type | Description |
---|---|
bool | true if any of the following conditions is true:
false if none of these conditions are true, or if |
Overrides
IsAssignableTo(Type)
Declaration
public bool IsAssignableTo(Type c)
Parameters
Type | Name | Description |
---|---|---|
Type | c |
Returns
Type | Description |
---|---|
bool |
IsByRefImpl()
When overridden in a derived class, implements the IsByRef property and determines whether the Type is passed by reference.
Declaration
protected override bool IsByRefImpl()
Returns
Type | Description |
---|---|
bool |
Overrides
IsCOMObjectImpl()
When overridden in a derived class, implements the IsCOMObject property and determines whether the Type is a COM object.
Declaration
protected override bool IsCOMObjectImpl()
Returns
Type | Description |
---|---|
bool |
Overrides
IsDefined(Type, bool)
When overridden in a derived class, indicates whether one or more attributes of the specified type or of its derived types is applied to this member.
Declaration
public override bool IsDefined(Type attributeType, bool inherit)
Parameters
Type | Name | Description |
---|---|---|
Type | attributeType | The type of custom attribute to search for. The search includes derived types. |
bool | inherit | true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events. |
Returns
Type | Description |
---|---|
bool | true if one or more instances of |
Overrides
IsPointerImpl()
When overridden in a derived class, implements the IsPointer property and determines whether the Type is a pointer.
Declaration
protected override bool IsPointerImpl()
Returns
Type | Description |
---|---|
bool |
Overrides
IsPrimitiveImpl()
When overridden in a derived class, implements the IsPrimitive property and determines whether the Type is one of the primitive types.
Declaration
protected override bool IsPrimitiveImpl()
Returns
Type | Description |
---|---|
bool | true if the Type is one of the primitive types; otherwise, false. |
Overrides
MakeArrayType()
Returns a Type object representing a one-dimensional array of the current type, with a lower bound of zero.
Declaration
public override Type MakeArrayType()
Returns
Type | Description |
---|---|
Type | A Type object representing a one-dimensional array of the current type, with a lower bound of zero. |
Overrides
Exceptions
Type | Condition |
---|---|
NotSupportedException | The invoked method is not supported in the base class. Derived classes must provide an implementation. |
TypeLoadException | The current type is TypedReference. -or- The current type is a |
MakeByRefType()
Returns a Type object that represents the current type when passed as a ref parameter (ByRef
parameter in Visual Basic).
Declaration
public override Type MakeByRefType()
Returns
Type | Description |
---|---|
Type | A Type object that represents the current type when passed as a ref parameter ( |
Overrides
Exceptions
Type | Condition |
---|---|
NotSupportedException | The invoked method is not supported in the base class. |
TypeLoadException | The current type is TypedReference. -or- The current type is a |
MakeGenericType(params Type[])
Substitutes the elements of an array of types for the type parameters of the current generic type definition and returns a Type object representing the resulting constructed type.
Declaration
public override Type MakeGenericType(params Type[] typeArguments)
Parameters
Type | Name | Description |
---|---|---|
Type[] | typeArguments | An array of types to be substituted for the type parameters of the current generic type. |
Returns
Type | Description |
---|---|
Type | A Type representing the constructed type formed by substituting the elements of |
Overrides
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The current type does not represent a generic type definition. That is, IsGenericTypeDefinition returns false. |
ArgumentNullException |
-or- Any element of |
ArgumentException | The number of elements in -or- Any element of -or-
|
NotSupportedException | The invoked method is not supported in the base class. Derived classes must provide an implementation. |
ToString()
Returns a String
representing the name of the current Type
.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |