Search Results for

    Show / Hide Table of Contents
    View Source

    Class ModelType

    Represents type declarations: class types, interface types, array types, value types, enumeration types, type parameters, generic type definitions, and open or closed constructed generic types.

    Inheritance
    object
    MemberInfo
    Type
    Namespace: Umbraco.Cms.Core.Models.PublishedContent
    Assembly: Umbraco.Core.dll
    Syntax
    public class ModelType : Type
    Examples

    ModelType.For("alias") typeof (IEnumerable{}).MakeGenericType(ModelType.For("alias")) Model.For("alias").MakeArrayType()

    Properties

    View Source

    Assembly

    Gets the System.Reflection.Assembly in which the type is declared. For generic types, gets the System.Reflection.Assembly in which the generic type is defined.

    Declaration
    public override Assembly Assembly { get; }
    Property Value
    Type Description
    Assembly

    An System.Reflection.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.

    View Source

    AssemblyQualifiedName

    Gets the assembly-qualified name of the type, which includes the name of the assembly from which this System.Type object was loaded.

    Declaration
    public override string AssemblyQualifiedName { get; }
    Property Value
    Type Description
    string

    The assembly-qualified name of the System.Type, which includes the name of the assembly from which the System.Type was loaded, or null if the current instance represents a generic type parameter.

    View Source

    BaseType

    Gets the type from which the current System.Type directly inherits.

    Declaration
    public override Type? BaseType { get; }
    Property Value
    Type Description
    Type

    The System.Type from which the current System.Type directly inherits, or null if the current Type represents the object class or an interface.

    View Source

    ContentTypeAlias

    Gets the content type alias.

    Declaration
    public string ContentTypeAlias { get; }
    Property Value
    Type Description
    string
    View Source

    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 byref type based on a type parameter, or a generic type that is not a generic type definition but contains unresolved type parameters.

    View Source

    GUID

    Gets the GUID associated with the System.Type.

    Declaration
    public override Guid GUID { get; }
    Property Value
    Type Description
    Guid

    The GUID associated with the System.Type.

    View Source

    Module

    Gets the module (the DLL) in which the current System.Type is defined.

    Declaration
    public override Module Module { get; }
    Property Value
    Type Description
    Module

    The module in which the current System.Type is defined.

    View Source

    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.

    View Source

    Namespace

    Gets the namespace of the System.Type.

    Declaration
    public override string Namespace { get; }
    Property Value
    Type Description
    string

    The namespace of the System.Type; null if the current instance has no namespace or represents a generic parameter.

    View Source

    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 System.Type.

    Methods

    View Source

    Equals(Type, Type)

    Gets a value indicating whether two System.Type instances are equal.

    Declaration
    public static bool Equals(Type t1, Type t2)
    Parameters
    Type Name Description
    Type t1

    The first instance.

    Type t2

    The second instance.

    Returns
    Type Description
    bool

    A value indicating whether the two instances are equal.

    Remarks

    Knows how to compare ModelType instances.

    View Source

    For(string?)

    Gets the model type for a published element type.

    Declaration
    public static ModelType For(string? alias)
    Parameters
    Type Name Description
    string alias

    The published element type alias.

    Returns
    Type Description
    ModelType

    The model type for the published element type.

    View Source

    GetAttributeFlagsImpl()

    When overridden in a derived class, implements the System.Type.Attributes property and gets a bitwise combination of enumeration values that indicate the attributes associated with the System.Type.

    Declaration
    protected override TypeAttributes GetAttributeFlagsImpl()
    Returns
    Type Description
    TypeAttributes

    A System.Reflection.TypeAttributes object representing the attribute set of the System.Type.

    View Source

    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-

    System.Reflection.BindingFlags.Default 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 System.Type.DefaultBinder.

    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 System.Type objects representing the number, order, and type of the parameters for the constructor to get.

    -or-

    An empty array of the type System.Type (that is, Type[] types = new Type[0]) to get a constructor that takes no parameters.

    ParameterModifier[] modifiers

    An array of System.Reflection.ParameterModifier objects representing the attributes associated with the corresponding element in the types array. The default binder does not process this parameter.

    Returns
    Type Description
    ConstructorInfo

    A System.Reflection.ConstructorInfo object representing the constructor that matches the specified requirements, if found; otherwise, null.

    Exceptions
    Type Condition
    ArgumentNullException
       <code class="paramref">types</code> is <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a>.
    

    -or-

    One of the elements in types is null.

    ArgumentException
       <code class="paramref">types</code> is multidimensional.
    

    -or-

    modifiers is multidimensional.

    -or-

    types and modifiers do not have the same length.

    NotSupportedException

    The current type is a System.Reflection.Emit.TypeBuilder or System.Reflection.Emit.GenericTypeParameterBuilder.

    View Source

    GetConstructors(BindingFlags)

    When overridden in a derived class, searches for the constructors defined for the current System.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-

    System.Reflection.BindingFlags.Default to return an empty array.

    Returns
    Type Description
    ConstructorInfo[]

    An array of System.Reflection.ConstructorInfo objects representing all constructors defined for the current System.Type that match the specified binding constraints, including the type initializer if it's defined. Returns an empty array of type System.Reflection.ConstructorInfo if no constructors are defined for the current System.Type, if none of the defined constructors match the binding constraints, or if the current System.Type represents a type parameter in the definition of a generic type or generic method.

    View Source

    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.

    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.

    View Source

    GetCustomAttributes(Type, bool)

    When overridden in a derived class, returns an array of custom attributes applied to this member and identified by System.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 attributeType have been applied.

    Exceptions
    Type Condition
    TypeLoadException

    A custom attribute type cannot be loaded.

    ArgumentNullException

    If attributeType is null.

    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.

    View Source

    GetElementType()

    When overridden in a derived class, returns the System.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 System.Type of the object encompassed or referred to by the current array, pointer, or reference type, or null if the current System.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.

    View Source

    GetEvent(string, BindingFlags)

    When overridden in a derived class, returns the System.Reflection.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 name of an event that is declared or inherited by the current System.Type.

    BindingFlags bindingAttr

    A bitwise combination of the enumeration values that specify how the search is conducted.

    -or-

    System.Reflection.BindingFlags.Default to return null.

    Returns
    Type Description
    EventInfo

    The object representing the specified event that is declared or inherited by the current System.Type, if found; otherwise, null.

    Exceptions
    Type Condition
    ArgumentNullException

    name is null.

    View Source

    GetEvents(BindingFlags)

    When overridden in a derived class, searches for events that are declared or inherited by the current System.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-

    System.Reflection.BindingFlags.Default to return an empty array.

    Returns
    Type Description
    EventInfo[]

    An array of System.Reflection.EventInfo objects representing all events that are declared or inherited by the current System.Type that match the specified binding constraints.

    -or-

    An empty array of type System.Reflection.EventInfo, if the current System.Type does not have events, or if none of the events match the binding constraints.

    View Source

    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-

    System.Reflection.BindingFlags.Default to return null.

    Returns
    Type Description
    FieldInfo

    An object representing the field that matches the specified requirements, if found; otherwise, null.

    Exceptions
    Type Condition
    ArgumentNullException

    name is null.

    View Source

    GetFields(BindingFlags)

    When overridden in a derived class, searches for the fields defined for the current System.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-

    System.Reflection.BindingFlags.Default to return an empty array.

    Returns
    Type Description
    FieldInfo[]

    An array of System.Reflection.FieldInfo objects representing all fields defined for the current System.Type that match the specified binding constraints.

    -or-

    An empty array of type System.Reflection.FieldInfo, if no fields are defined for the current System.Type, or if none of the defined fields match the binding constraints.

    View Source

    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
       <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a> to ignore the case of that part of <code class="paramref">name</code> that specifies the simple interface name (the part that specifies the namespace must be correctly cased).
    

    -or-

    false to perform a case-sensitive search for all parts of name.

    Returns
    Type Description
    Type

    An object representing the interface with the specified name, implemented or inherited by the current System.Type, if found; otherwise, null.

    Exceptions
    Type Condition
    ArgumentNullException

    name is null.

    AmbiguousMatchException

    The current System.Type represents a type that implements the same generic interface with different type arguments.

    View Source

    GetInterfaces()

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

    Declaration
    public override Type[] GetInterfaces()
    Returns
    Type Description
    Type[]

    An array of System.Type objects representing all the interfaces implemented or inherited by the current System.Type.

    -or-

    An empty array of type System.Type, if no interfaces are implemented or inherited by the current System.Type.

    Exceptions
    Type Condition
    TargetInvocationException

    A static initializer is invoked and throws an exception.

    View Source

    GetMembers(BindingFlags)

    When overridden in a derived class, searches for the members defined for the current System.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-

    System.Reflection.BindingFlags.Default to return an empty array.

    Returns
    Type Description
    MemberInfo[]

    An array of System.Reflection.MemberInfo objects representing all members defined for the current System.Type that match the specified binding constraints.

    -or-

    An empty array if no members are defined for the current System.Type, or if none of the defined members match the binding constraints.

    View Source

    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-

    System.Reflection.BindingFlags.Default 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 System.Type.DefaultBinder.

    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 System.Type objects representing the number, order, and type of the parameters for the method to get.

    -or-

    An empty array of the type System.Type (that is, Type[] types = new Type[0]) to get a method that takes no parameters.

    -or-

    null. If types is null, arguments are not matched.

    ParameterModifier[] modifiers

    An array of System.Reflection.ParameterModifier objects representing the attributes associated with the corresponding element in the types array. The default binder does not process this parameter.

    Returns
    Type Description
    MethodInfo

    An object representing the method that matches the specified requirements, if found; otherwise, null.

    Exceptions
    Type Condition
    AmbiguousMatchException

    More than one method is found with the specified name and matching the specified binding constraints.

    ArgumentNullException

    name is null.

    ArgumentException
       <code class="paramref">types</code> is multidimensional.
    

    -or-

    modifiers is multidimensional.

    -or-

    types and modifiers do not have the same length.

    NotSupportedException

    The current type is a System.Reflection.Emit.TypeBuilder or System.Reflection.Emit.GenericTypeParameterBuilder.

    View Source

    GetMethods(BindingFlags)

    When overridden in a derived class, searches for the methods defined for the current System.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-

    System.Reflection.BindingFlags.Default to return an empty array.

    Returns
    Type Description
    MethodInfo[]

    An array of System.Reflection.MethodInfo objects representing all methods defined for the current System.Type that match the specified binding constraints.

    -or-

    An empty array of type System.Reflection.MethodInfo, if no methods are defined for the current System.Type, or if none of the defined methods match the binding constraints.

    View Source

    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-

    System.Reflection.BindingFlags.Default to return null.

    Returns
    Type Description
    Type

    An object representing the nested type that matches the specified requirements, if found; otherwise, null.

    Exceptions
    Type Condition
    ArgumentNullException

    name is null.

    View Source

    GetNestedTypes(BindingFlags)

    When overridden in a derived class, searches for the types nested in the current System.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-

    System.Reflection.BindingFlags.Default to return null.

    Returns
    Type Description
    Type[]

    An array of System.Type objects representing all the types nested in the current System.Type that match the specified binding constraints (the search is not recursive), or an empty array of type System.Type, if no nested types are found that match the binding constraints.

    View Source

    GetProperties(BindingFlags)

    When overridden in a derived class, searches for the properties of the current System.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-

    System.Reflection.BindingFlags.Default to return an empty array.

    Returns
    Type Description
    PropertyInfo[]

    An array of objects representing all properties of the current System.Type that match the specified binding constraints.

    -or-

    An empty array of type System.Reflection.PropertyInfo, if the current System.Type does not have properties, or if none of the properties match the binding constraints.

    View Source

    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-

    System.Reflection.BindingFlags.Default 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 System.Type.DefaultBinder.

    Type returnType

    The return type of the property.

    Type[] types

    An array of System.Type objects representing the number, order, and type of the parameters for the indexed property to get.

    -or-

    An empty array of the type System.Type (that is, Type[] types = new Type[0]) to get a property that is not indexed.

    ParameterModifier[] modifiers

    An array of System.Reflection.ParameterModifier objects representing the attributes associated with the corresponding element in the types array. The default binder does not process this parameter.

    Returns
    Type Description
    PropertyInfo

    An object representing the property that matches the specified requirements, if found; otherwise, null.

    Exceptions
    Type Condition
    AmbiguousMatchException

    More than one property is found with the specified name and matching the specified binding constraints.

    ArgumentNullException
       <code class="paramref">name</code> is <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a>.
    

    -or-

    types is null.

    -or-

    One of the elements in types is null.

    ArgumentException
       <code class="paramref">types</code> is multidimensional.
    

    -or-

    modifiers is multidimensional.

    -or-

    types and modifiers do not have the same length.

    NotSupportedException

    The current type is a System.Reflection.Emit.TypeBuilder, System.Reflection.Emit.EnumBuilder, or System.Reflection.Emit.GenericTypeParameterBuilder.

    View Source

    HasElementTypeImpl()

    When overridden in a derived class, implements the System.Type.HasElementType property and determines whether the current System.Type encompasses or refers to another type; that is, whether the current System.Type is an array, a pointer, or is passed by reference.

    Declaration
    protected override bool HasElementTypeImpl()
    Returns
    Type Description
    bool

    true if the System.Type is an array, a pointer, or is passed by reference; otherwise, false.

    View Source

    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 IDispatch members, a string representing the DispID, for example "[DispID=3]".

    BindingFlags invokeAttr

    A bitwise combination of the enumeration values that specify how the search is conducted. The access can be one of the BindingFlags such as Public, NonPublic, Private, InvokeMethod, GetField, and so on. The type of lookup need not be specified. If the type of lookup is omitted, BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static are used.

    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 System.Type.DefaultBinder. Note that explicitly defining a System.Reflection.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 System.Reflection.ParameterModifier objects representing the attributes associated with the corresponding element in the args array. A parameter's associated attributes are stored in the member's signature.

    The default binder processes this parameter only when calling a COM component.

    CultureInfo culture

    The System.Globalization.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 (Nothing in Visual Basic) to use the current thread's System.Globalization.CultureInfo.

    string[] namedParameters

    An array containing the names of the parameters to which the values in the args array are passed.

    Returns
    Type Description
    object

    An object representing the return value of the invoked member.

    Exceptions
    Type Condition
    ArgumentNullException

    invokeAttr does not contain CreateInstance and name is null.

    ArgumentException
       <code class="paramref">args</code> and <code class="paramref">modifiers</code> do not have the same length.
    

    -or-

    invokeAttr is not a valid System.Reflection.BindingFlags attribute.

    -or-

    invokeAttr does not contain one of the following binding flags: InvokeMethod, CreateInstance, GetField, SetField, GetProperty, or SetProperty.

    -or-

    invokeAttr contains CreateInstance combined with InvokeMethod, GetField, SetField, GetProperty, or SetProperty.

    -or-

    invokeAttr contains both GetField and SetField.

    -or-

    invokeAttr contains both GetProperty and SetProperty.

    -or-

    invokeAttr contains InvokeMethod combined with SetField or SetProperty.

    -or-

    invokeAttr contains SetField and args has more than one element.

    -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: BindingFlags.InvokeMethod, BindingFlags.GetProperty, BindingFlags.SetProperty, BindingFlags.PutDispProperty, or BindingFlags.PutRefDispProperty.

    -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 args.

    -or-

    No member can be found that has the argument names supplied in namedParameters.

    -or-

    The current System.Type object represents a type that contains open type parameters, that is, System.Type.ContainsGenericParameters returns true.

    TargetException

    The specified member cannot be invoked on target.

    AmbiguousMatchException

    More than one method matches the binding criteria.

    InvalidOperationException

    The method represented by name has one or more unspecified generic type parameters. That is, the method's System.Reflection.MethodBase.ContainsGenericParameters property returns true.

    View Source

    IsArrayImpl()

    When overridden in a derived class, implements the System.Type.IsArray property and determines whether the System.Type is an array.

    Declaration
    protected override bool IsArrayImpl()
    Returns
    Type Description
    bool

    true if the System.Type is an array; otherwise, false.

    View Source

    IsByRefImpl()

    When overridden in a derived class, implements the System.Type.IsByRef property and determines whether the System.Type is passed by reference.

    Declaration
    protected override bool IsByRefImpl()
    Returns
    Type Description
    bool

    true if the System.Type is passed by reference; otherwise, false.

    View Source

    IsCOMObjectImpl()

    When overridden in a derived class, implements the System.Type.IsCOMObject property and determines whether the System.Type is a COM object.

    Declaration
    protected override bool IsCOMObjectImpl()
    Returns
    Type Description
    bool

    true if the System.Type is a COM object; otherwise, false.

    View Source

    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 attributeType or any of its derived types is applied to this member; otherwise, false.

    View Source

    IsPointerImpl()

    When overridden in a derived class, implements the System.Type.IsPointer property and determines whether the System.Type is a pointer.

    Declaration
    protected override bool IsPointerImpl()
    Returns
    Type Description
    bool

    true if the System.Type is a pointer; otherwise, false.

    View Source

    IsPrimitiveImpl()

    When overridden in a derived class, implements the System.Type.IsPrimitive property and determines whether the System.Type is one of the primitive types.

    Declaration
    protected override bool IsPrimitiveImpl()
    Returns
    Type Description
    bool

    true if the System.Type is one of the primitive types; otherwise, false.

    View Source

    MakeArrayType()

    Returns a System.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 System.Type object representing a one-dimensional array of the current type, with a lower bound of zero.

    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 System.TypedReference.

    -or-

    The current type is a ByRef type. That is, System.Type.IsByRef returns true.

    View Source

    Map(Type, Dictionary<string, Type>?)

    Gets the actual CLR type by replacing model types, if any.

    Declaration
    public static Type Map(Type type, Dictionary<string, Type>? modelTypes)
    Parameters
    Type Name Description
    Type type

    The type.

    Dictionary<string, Type> modelTypes

    The model types map.

    Returns
    Type Description
    Type

    The actual CLR type.

    View Source

    Map(Type, Dictionary<string, Type>?, bool)

    Declaration
    public static Type Map(Type type, Dictionary<string, Type>? modelTypes, bool dictionaryIsInvariant)
    Parameters
    Type Name Description
    Type type
    Dictionary<string, Type> modelTypes
    bool dictionaryIsInvariant
    Returns
    Type Description
    Type
    View Source

    MapToName(Type, Dictionary<string, string>)

    Gets the actual CLR type name by replacing model types, if any.

    Declaration
    public static string MapToName(Type type, Dictionary<string, string> map)
    Parameters
    Type Name Description
    Type type

    The type.

    Dictionary<string, string> map

    The model types map.

    Returns
    Type Description
    string

    The actual CLR type name.

    View Source

    ToString()

    Returns a String representing the name of the current Type.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A string representing the name of the current System.Type.

    • Edit this page
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX