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
 - 
      objectObjectFactoryRegistry
 
Methods
CanCreateInstance(Type)
Returns true if the object of the specific type can be created.
public static bool CanCreateInstance(Type objectType)
  Parameters
objectTypeTypeType 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
objectTypeTypeThe object type for which to retrieve the factory.
Returns
- IObjectFactory
 The factory corresponding to the given object type if available,
nullotherwise.
Exceptions
- ArgumentNullException
 objectType
NewInstance(Type)
Creates a default instance for an object type.
public static object NewInstance(Type objectType)
  Parameters
objectTypeTypeType 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
TType of the object to create