logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class DefaultInstanceActivator

    Default instance activator using CreateInstance(Type). Requires a public parameterless constructor. Runtime-specific activators can be injected to handle special types.

    Inheritance
    object
    DefaultInstanceActivator
    Implements
    IInstanceActivator
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    Namespace: Serenity.Tasking.Application.Utils
    Assembly: Serenity.Global.Application.dll
    Syntax
    public sealed class DefaultInstanceActivator : IInstanceActivator

    Constructors

    DefaultInstanceActivator()

    Declaration
    public DefaultInstanceActivator()

    Methods

    CreateInstance(Type)

    Creates an instance of the specified type.

    Declaration
    public object CreateInstance(Type type)
    Parameters
    Type Name Description
    Type type

    The type to instantiate.

    Returns
    Type Description
    object

    A new instance of the type.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown when the type cannot be instantiated (e.g. no parameterless constructor and no special creation strategy).

    RequiresSpecialContext(Type)

    Determines whether instantiating this type requires special runtime conditions (e.g. main-thread affinity in Unity).

    Declaration
    public bool RequiresSpecialContext(Type type)
    Parameters
    Type Name Description
    Type type

    The type to check.

    Returns
    Type Description
    bool

    True if instantiation has special requirements.

    Remarks

    The default activator has no special context requirements. Always returns false.

    Implements

    IInstanceActivator
    In this article
    © 2026 Serenity. All Rights Reserved