Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    ObjectFactoryRegistry Class

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

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

    System.Object → ObjectFactoryRegistry
    Derived from ObjectFactoryRegistry:

    public static class ObjectFactoryRegistry
    Name Description
    Methods
    CanCreateInstance(Type)

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

    GetFactory(Type)

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

    NewInstance(Type)

    Creates a default instance for an object type.

    NewInstance<T>()

    Creates a default instance for an object type.

    | Improve this Doc View Source

    Methods


    CanCreateInstance(Type)

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

    public static bool CanCreateInstance(Type objectType)
    Parameters
    Type Name Description
    System.Type objectType

    Type of the object.

    Returns
    Type Description
    System.Boolean

    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
    Type Name Description
    System.Type objectType

    The object type for which to retrieve the factory.

    Returns
    Type Description
    IObjectFactory

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

    Exceptions
    Type Condition
    System.ArgumentNullException

    objectType


    NewInstance(Type)

    Creates a default instance for an object type.

    public static object NewInstance(Type objectType)
    Parameters
    Type Name Description
    System.Type objectType

    Type of the object.

    Returns
    Type Description
    System.Object

    A new default instance of an object.


    NewInstance<T>()

    Creates a default instance for an object type.

    public static T NewInstance<T>()
    Returns
    Type Description
    T

    A new instance of T

    Type Parameters
    Name Description
    T

    Type of the object to create


    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation