Table of Contents

Class TypeListCache

Namespace
Garyon.Reflection
Assembly
Garyon.dll

Contains a cached list of types and exposes filtered views for them.

public sealed class TypeListCache : IReadOnlyList<Type>, IReadOnlyCollection<Type>, IEnumerable<Type>, IEnumerable
Inheritance
TypeListCache
Implements
Inherited Members
Extension Methods

Constructors

TypeListCache(IEnumerable<Type>)

Initializes a new instance of the TypeListCache class.

public TypeListCache(IEnumerable<Type> types)

Parameters

types IEnumerable<Type>

The types to cache.

Properties

Count

Gets the number of cached types.

public int Count { get; }

Property Value

int

this[int]

Gets the type at the given index.

public Type this[int index] { get; }

Parameters

index int

Property Value

Type

Types

Gets the cached types.

public IReadOnlyList<Type> Types { get; }

Property Value

IReadOnlyList<Type>

Methods

GetAbstractClasses()

Gets all the abstract classes in the cached types.

public IEnumerable<Type> GetAbstractClasses()

Returns

IEnumerable<Type>

GetClasses()

Gets all the classes in the cached types.

public IEnumerable<Type> GetClasses()

Returns

IEnumerable<Type>

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<Type> GetEnumerator()

Returns

IEnumerator<Type>

An enumerator that can be used to iterate through the collection.

GetFilteredTypes(Predicate<Type>)

Gets a filtered view of the cached types.

public IEnumerable<Type> GetFilteredTypes(Predicate<Type> predicate)

Parameters

predicate Predicate<Type>

The predicate to filter the types with.

Returns

IEnumerable<Type>

GetInterfaces()

Gets all the interfaces in the cached types.

public IEnumerable<Type> GetInterfaces()

Returns

IEnumerable<Type>

GetNonAbstractClasses()

Gets all the non-abstract classes in the cached types.

public IEnumerable<Type> GetNonAbstractClasses()

Returns

IEnumerable<Type>

GetStaticClasses()

Gets all the static classes in the cached types.

public IEnumerable<Type> GetStaticClasses()

Returns

IEnumerable<Type>

GetStructs()

Gets all the structs in the cached types.

public IEnumerable<Type> GetStructs()

Returns

IEnumerable<Type>