Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class DefaultNamespaceTypeWrapper

    The TypeWrapper class wraps a Type so it may be used in a platform-independent manner. This class overrides the namespace to return null so it is only run once per assembly.

    Inheritance
    object
    DefaultNamespaceTypeWrapper
    Implements
    ITypeInfo
    IReflectionInfo
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Lucene.Net.Util
    Assembly: Lucene.Net.TestFramework.dll
    Syntax
    public class DefaultNamespaceTypeWrapper : ITypeInfo, IReflectionInfo

    Constructors

    DefaultNamespaceTypeWrapper(Type)

    Construct a TypeWrapper for a specified Type.

    Declaration
    public DefaultNamespaceTypeWrapper(Type type)
    Parameters
    Type Name Description
    Type type

    Properties

    Assembly

    Gets the assembly in which the type is declared

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

    BaseType

    Gets the base type of this type as an ITypeInfo

    Declaration
    public ITypeInfo BaseType { get; }
    Property Value
    Type Description
    ITypeInfo

    ContainsGenericParameters

    Gets a value indicating whether the Type has generic parameters that have not been replaced by specific Types.

    Declaration
    public bool ContainsGenericParameters { get; }
    Property Value
    Type Description
    bool

    FullName

    Gets the FullName of the Type

    Declaration
    public string FullName { get; }
    Property Value
    Type Description
    string

    IsAbstract

    Gets a value indicating whether the type is abstract.

    Declaration
    public bool IsAbstract { get; }
    Property Value
    Type Description
    bool

    IsGenericType

    Gets a value indicating whether the Type is a generic Type

    Declaration
    public bool IsGenericType { get; }
    Property Value
    Type Description
    bool

    IsGenericTypeDefinition

    Gets a value indicating whether the Type is a generic Type definition

    Declaration
    public bool IsGenericTypeDefinition { get; }
    Property Value
    Type Description
    bool

    IsSealed

    Gets a value indicating whether the type is sealed.

    Declaration
    public bool IsSealed { get; }
    Property Value
    Type Description
    bool

    IsStaticClass

    Gets a value indicating whether this type represents a static class.

    Declaration
    public bool IsStaticClass { get; }
    Property Value
    Type Description
    bool

    Name

    Gets the Name of the Type

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

    Namespace

    Gets the namespace of the Type

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

    Type

    Gets the underlying Type on which this TypeWrapper is based.

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

    Methods

    Construct(object[])

    Construct an object of this Type, using the specified arguments.

    Declaration
    public object Construct(object[] args)
    Parameters
    Type Name Description
    object[] args
    Returns
    Type Description
    object

    GetConstructor(Type[])

    Gets the public constructor taking the specified argument Types

    Declaration
    public ConstructorInfo GetConstructor(Type[] argTypes)
    Parameters
    Type Name Description
    Type[] argTypes
    Returns
    Type Description
    ConstructorInfo

    GetCustomAttributes<T>(bool)

    Returns an array of custom attributes of the specified type applied to this type

    Declaration
    public T[] GetCustomAttributes<T>(bool inherit) where T : class
    Parameters
    Type Name Description
    bool inherit
    Returns
    Type Description
    T[]
    Type Parameters
    Name Description
    T

    GetDisplayName()

    Get the display name for this type

    Declaration
    public string GetDisplayName()
    Returns
    Type Description
    string

    GetDisplayName(object[])

    Get the display name for an object of this type, constructed with the specified args.

    Declaration
    public string GetDisplayName(object[] args)
    Parameters
    Type Name Description
    object[] args
    Returns
    Type Description
    string

    GetGenericTypeDefinition()

    Returns a Type representing a generic type definition from which this Type can be constructed.

    Declaration
    public Type GetGenericTypeDefinition()
    Returns
    Type Description
    Type

    GetMethods(BindingFlags)

    Returns an array of IMethodInfos for methods of this Type that match the specified flags.

    Declaration
    public IMethodInfo[] GetMethods(BindingFlags flags)
    Parameters
    Type Name Description
    BindingFlags flags
    Returns
    Type Description
    IMethodInfo[]

    GetMethodsWithAttribute<T>(bool)

    Returns all methods declared by this type that have the specified attribute, optionally including base classes. Methods from a base class are always returned before methods from a class that inherits from it.

    Declaration
    public IMethodInfo[] GetMethodsWithAttribute<T>(bool inherit) where T : class
    Parameters
    Type Name Description
    bool inherit

    Specifies whether to search the fixture type inheritance chain.

    Returns
    Type Description
    IMethodInfo[]
    Type Parameters
    Name Description
    T

    HasConstructor(Type[])

    Returns a value indicating whether this Type has a public constructor taking the specified argument Types.

    Declaration
    public bool HasConstructor(Type[] argTypes)
    Parameters
    Type Name Description
    Type[] argTypes
    Returns
    Type Description
    bool

    HasMethodWithAttribute(Type)

    Returns a flag indicating whether this type has a method with an attribute of the specified type.

    Declaration
    public bool HasMethodWithAttribute(Type attributeType)
    Parameters
    Type Name Description
    Type attributeType
    Returns
    Type Description
    bool

    IsDefined<T>(bool)

    Returns a value indicating whether the type has an attribute of the specified type.

    Declaration
    public bool IsDefined<T>(bool inherit) where T : class
    Parameters
    Type Name Description
    bool inherit
    Returns
    Type Description
    bool
    Type Parameters
    Name Description
    T

    IsType(Type)

    Returns true if the Type wrapped is T

    Declaration
    public bool IsType(Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    bool

    MakeGenericType(Type[])

    Returns a new ITypeInfo representing an instance of this generic Type using the supplied Type arguments

    Declaration
    public ITypeInfo MakeGenericType(Type[] typeArgs)
    Parameters
    Type Name Description
    Type[] typeArgs
    Returns
    Type Description
    ITypeInfo

    ToString()

    Override ToString() so that error messages in NUnit's own tests make sense

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()

    Implements

    NUnit.Framework.Interfaces.ITypeInfo
    NUnit.Framework.Interfaces.IReflectionInfo
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.