logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Interface IInstanceActivator

    Creates instances of types for reflective invocation. Implementations handle runtime-specific instantiation strategies (e.g. Unity ScriptableObjects, Components, or plain CLR objects).

    Namespace: Serenity.Tasking.Application.Interfaces
    Assembly: Serenity.Global.Application.dll
    Syntax
    public interface IInstanceActivator

    Methods

    CreateInstance(Type)

    Creates an instance of the specified type.

    Declaration
    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
    bool RequiresSpecialContext(Type type)
    Parameters
    Type Name Description
    Type type

    The type to check.

    Returns
    Type Description
    bool

    True if instantiation has special requirements.

    In this article
    © 2026 Serenity. All Rights Reserved