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
typesIEnumerable<Type>The types to cache.
Properties
Count
Gets the number of cached types.
public int Count { get; }
Property Value
this[int]
Gets the type at the given index.
public Type this[int index] { get; }
Parameters
indexint
Property Value
Types
Gets the cached types.
public IReadOnlyList<Type> Types { get; }
Property Value
Methods
GetAbstractClasses()
Gets all the abstract classes in the cached types.
public IEnumerable<Type> GetAbstractClasses()
Returns
GetClasses()
Gets all the classes in the cached types.
public IEnumerable<Type> GetClasses()
Returns
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
Returns
GetInterfaces()
Gets all the interfaces in the cached types.
public IEnumerable<Type> GetInterfaces()
Returns
GetNonAbstractClasses()
Gets all the non-abstract classes in the cached types.
public IEnumerable<Type> GetNonAbstractClasses()
Returns
GetStaticClasses()
Gets all the static classes in the cached types.
public IEnumerable<Type> GetStaticClasses()
Returns
GetStructs()
Gets all the structs in the cached types.
public IEnumerable<Type> GetStructs()