Show / Hide Table of Contents

Class TypeDeriver<T>

Helper class used to enumerate subclasses of a given type from multiple assemblies.

Inheritance
object
TypeDeriver<T>
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Microsoft.XboxStudios.GameStateTracker
Assembly: GameStateTracker.Types.dll
Syntax
public static class TypeDeriver<T>
Type Parameters
Name Description
T

The base type.

Properties

View Source

Assemblies

Gets a set of assemblies to look for subclasses of type .

Declaration
public static ISet<Assembly> Assemblies { get; }
Property Value
Type Description
ISet<Assembly>
View Source

Mappings

Gets a set of hard-coded type mappings.

Declaration
public static IDictionary<string, Type> Mappings { get; }
Property Value
Type Description
IDictionary<string, Type>

Methods

View Source

GetType(Func<Type, bool>)

Gets the first subclass of matching the given predicate.

Declaration
public static Type? GetType(Func<Type, bool> predicate)
Parameters
Type Name Description
Func<Type, bool> predicate

The predicate.

Returns
Type Description
Type

The type, or null if none were found.

View Source

GetType(string)

Gets the first subclass of matching the given name.

Declaration
public static Type? GetType(string name)
Parameters
Type Name Description
string name

The type name.

Returns
Type Description
Type

The type, or null if none were found.

View Source

GetTypes(Func<Type, bool>)

Gets all subclasses of matching the given predicate.

Declaration
public static IEnumerable<Type> GetTypes(Func<Type, bool> predicate)
Parameters
Type Name Description
Func<Type, bool> predicate

The predicate.

Returns
Type Description
IEnumerable<Type>

An enumerable of types.

View Source

GetTypes(Assembly?, Func<Type, bool>?)

Gets all subclasses of from the assembly matching the given predicate.

Declaration
public static IEnumerable<Type> GetTypes(Assembly? assembly = null, Func<Type, bool>? predicate = null)
Parameters
Type Name Description
Assembly assembly

The assembly.

Func<Type, bool> predicate

The predicate.

Returns
Type Description
IEnumerable<Type>

An enumerable of types.

View Source

GetTypes(string)

Gets all subclasses of matching the given name.

Declaration
public static IEnumerable<Type> GetTypes(string name)
Parameters
Type Name Description
string name

The type name.

Returns
Type Description
IEnumerable<Type>

An enumerable of types.

  • View Source
In this article
Back to top Generated by DocFX