Table of Contents

Class TypeStore

Namespace
Tripous
Assembly
Tripous.dll

Global store of discoverable application types.

public static class TypeStore
Inheritance
TypeStore
Inherited Members

Methods

Clear()

Clears the internal store.

public static void Clear()

Contains(string)

Returns true if a type exists in the store.

public static bool Contains(string TypeName)

Parameters

TypeName string

Returns

bool

CreateInstance(string, Type)

Creates and returns an instance of a type.

public static object CreateInstance(string TypeName, Type BaseType = null)

Parameters

TypeName string
BaseType Type

Returns

object

CreateInstance<T>(string)

Creates and returns an instance of a type.

public static T CreateInstance<T>(string TypeName) where T : class

Parameters

TypeName string

Returns

T

Type Parameters

T

Find(string)

Finds and returns a type, if any, else null.

public static Type Find(string TypeName)

Parameters

TypeName string

Returns

Type

Get(string)

Finds and returns a type, if any, else exception.

public static Type Get(string TypeName)

Parameters

TypeName string

Returns

Type

LoadAndRegisterAssemblies(params string[])

Loads and registers all discoverable types of all assemblies in the specified folders.

public static void LoadAndRegisterAssemblies(params string[] FolderPaths)

Parameters

FolderPaths string[]

Register(Assembly)

Registers all discoverable types of an assembly.

public static void Register(Assembly Assembly)

Parameters

Assembly Assembly

Register(Type)

Registers a single type.

public static void Register(Type Type)

Parameters

Type Type

RegisterApplicationAssemblies()

Registers all discoverable types of application assemblies.

public static void RegisterApplicationAssemblies()

RegisterLoadedAssemblies()

Registers all discoverable types of all loaded assemblies.

public static void RegisterLoadedAssemblies()

Resolve(string, Type, bool)

Resolves and returns a type.

public static Type Resolve(string TypeName, Type BaseType = null, bool ThrowIfNotFound = true)

Parameters

TypeName string
BaseType Type
ThrowIfNotFound bool

Returns

Type