Table of Contents

Class ObjectFactoryRegistry

Namespace
Stride.Core.Reflection
Assembly
Stride.Core.dll

A registry of IObjectFactory used to instantiate instances of types used at design-time.

public static class ObjectFactoryRegistry
Inheritance
ObjectFactoryRegistry

Methods

CanCreateInstance(Type)

Returns true if the object of the specific type can be created.

public static bool CanCreateInstance(Type objectType)

Parameters

objectType Type

Type of the object.

Returns

bool

True if it can be created, false otherwise.

GetFactory(Type)

Gets the factory corresponding to the given object type, if available.

public static IObjectFactory GetFactory(Type objectType)

Parameters

objectType Type

The object type for which to retrieve the factory.

Returns

IObjectFactory

The factory corresponding to the given object type if available, null otherwise.

Exceptions

ArgumentNullException

objectType

NewInstance(Type)

Creates a default instance for an object type.

public static object NewInstance(Type objectType)

Parameters

objectType Type

Type of the object.

Returns

object

A new default instance of an object.

NewInstance<T>()

Creates a default instance for an object type.

public static T NewInstance<T>()

Returns

T

A new instance of T

Type Parameters

T

Type of the object to create