Show / Hide Table of Contents

    Class TypeIdentifier

    Representation of a .NET type name, allowing access to the individual parts of the type name, both for reading and for modification.

    Inheritance
    Object
    TypeIdentifier
    Implements
    IEquatable<TypeIdentifier>
    Inherited Members
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Alphaleonis.Reflection.Metadata
    Assembly: Alphaleonis.Reflection.Metadata.dll
    Syntax
    [Serializable]
    public class TypeIdentifier : IEquatable<TypeIdentifier>
    Remarks

    Use Parse(String) to create a new instance of a TypeIdentifier

    Properties

    | Improve this Doc View Source

    AssemblyName

    Gets or sets the assembly name in which this type resides. This may be null if no assembly name was provided.

    Declaration
    public AssemblyName AssemblyName { get; set; }
    Property Value
    Type Description
    AssemblyName
    | Improve this Doc View Source

    AssemblyQualifiedName

    Gets or sets the full assembly qualified name of the type.

    Declaration
    public string AssemblyQualifiedName { get; set; }
    Property Value
    Type Description
    String
    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when one or more required arguments are null.

    ArgumentException

    Thrown when one or more arguments have unsupported or illegal values.

    | Improve this Doc View Source

    FullName

    Gets or sets the full name of the type. This is equivalent to FullName.

    Declaration
    public string FullName { get; set; }
    Property Value
    Type Description
    String
    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when one or more required arguments are null.

    ArgumentException

    Thrown when one or more arguments have unsupported or illegal values.

    | Improve this Doc View Source

    GenericArguments

    Gets a list containing the generic arguments of this type, or an empty list if no generic arguments are available.

    Declaration
    public IList<TypeIdentifier> GenericArguments { get; }
    Property Value
    Type Description
    IList<TypeIdentifier>
    | Improve this Doc View Source

    IsArray

    Returns true if this type is an array.

    Declaration
    public bool IsArray { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    IsPointer

    Returns true if this type is a pointer.

    Declaration
    public bool IsPointer { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    IsReference

    Returns true if this type is a reference.

    Declaration
    public bool IsReference { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    Name

    Gets or sets the simple name of the type without any array/pointer/byref specs.

    Declaration
    public string Name { get; set; }
    Property Value
    Type Description
    String

    The name.

    Remarks

    This is different from Name that does include the array/pointer/byRef specifiers.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when one or more required arguments are null.

    ArgumentException

    Thrown when one or more arguments have unsupported or illegal values.

    | Improve this Doc View Source

    Namespace

    Gets or sets the namespace of the type. May be null if the type is not contained within a namespace.

    Declaration
    public string Namespace { get; set; }
    Property Value
    Type Description
    String
    | Improve this Doc View Source

    NamespaceTypeName

    Gets or sets the namespace and type name, without any array/pointer/reference specifiers or generic arguments. For example the NamespaceTypeName of the type System.Collections.Generic.Dictionary2+KeyCollection[System.String,System.Int32][,]</code> is <code>System.Collections.Generic.Dictionary2+KeyCollection.

    Declaration
    public string NamespaceTypeName { get; set; }
    Property Value
    Type Description
    String

    The name of the namespace type.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when one or more required arguments are null.

    ArgumentException

    Thrown when one or more arguments have unsupported or illegal values.

    | Improve this Doc View Source

    TypeSpecifiers

    Gets or sets the specifiers indicating whether this type is an array, pointer or reference type.

    Declaration
    public IList<TypeSpecifier> TypeSpecifiers { get; }
    Property Value
    Type Description
    IList<TypeSpecifier>

    Methods

    | Improve this Doc View Source

    Equals(TypeIdentifier)

    Tests if this TypeIdentifier is considered equal to another.

    Declaration
    public bool Equals(TypeIdentifier other)
    Parameters
    Type Name Description
    TypeIdentifier other

    The type identifier to compare to this object.

    Returns
    Type Description
    Boolean

    True if the objects are considered equal, false if they are not.

    | Improve this Doc View Source

    Equals(Object)

    Tests if this object is considered equal to another.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj

    The object to compare to this object.

    Returns
    Type Description
    Boolean

    True if the objects are considered equal, false if they are not.

    Overrides
    Object.Equals(Object)
    | Improve this Doc View Source

    GetDeclaringType()

    Gets declaring type of this type if this type is a nested type, or returns null otherwise.

    Declaration
    public TypeIdentifier GetDeclaringType()
    Returns
    Type Description
    TypeIdentifier
    | Improve this Doc View Source

    GetElementType()

    Gets element type of this type if this type is an array, pointer or reference. Returns null otherwise.

    Declaration
    public TypeIdentifier GetElementType()
    Returns
    Type Description
    TypeIdentifier
    | Improve this Doc View Source

    GetHashCode()

    Calculates a hash code for this object.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32

    A hash code for this object.

    Overrides
    Object.GetHashCode()
    | Improve this Doc View Source

    Parse(String)

    Parses a type name. This may be an assembly qualified name, a full type name or a simple type name.

    Declaration
    public static TypeIdentifier Parse(string typeName)
    Parameters
    Type Name Description
    String typeName

    The type name to parse

    Returns
    Type Description
    TypeIdentifier

    A new TypeIdentifier representing the specified type.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when one or more required arguments are null.

    ArgumentException

    Thrown when one or more arguments have unsupported or illegal values.

    | Improve this Doc View Source

    ToString()

    Convert this object into a string representation.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    A string that represents this object.

    Overrides
    Object.ToString()

    Implements

    System.IEquatable<T>
    • Improve this Doc
    • View Source
    Back to top Copyright © 2018 Peter Palotas