Class TypeDeriver<T>
Helper class used to enumerate subclasses of a given type from multiple assemblies.
Inherited Members
Namespace: Microsoft.XboxStudios.GameStateTracker
Assembly: GameStateTracker.Types.dll
Syntax
public static class TypeDeriver<T>
Type Parameters
Name | Description |
---|---|
T | The base type. |
Properties
View SourceAssemblies
Gets a set of assemblies to look for subclasses of type
Declaration
public static ISet<Assembly> Assemblies { get; }
Property Value
Type | Description |
---|---|
ISet<Assembly> |
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 SourceGetType(Func<Type, bool>)
Gets the first subclass of
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. |
GetType(string)
Gets the first subclass of
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. |
GetTypes(Func<Type, bool>)
Gets all subclasses of
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. |
GetTypes(Assembly?, Func<Type, bool>?)
Gets all subclasses of
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. |
GetTypes(string)
Gets all subclasses of
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. |