Search Results for

    Show / Hide Table of Contents

    Class ServiceInterceptor

    Manages Service instances from registered in the Container.

    Inheritance
    object
    ContainerInterceptor
    ContainerInterceptor<Service>
    ServiceInterceptor
    Inherited Members
    ContainerInterceptor<Service>.OnInstanced(object)
    ContainerInterceptor.Type
    ContainerInterceptor.Container
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Evergine.Framework.Services
    Assembly: Evergine.Framework.dll
    Syntax
    public class ServiceInterceptor : ContainerInterceptor<Service>
    Remarks

    Registered Service instances that inherit from UpdatableService will be updated automatically by this instance. This update order depends on the order in which Service instances where registered (first registered, first to be updated and so on).

    Constructors

    ServiceInterceptor()

    Initializes a new instance of the ServiceInterceptor class.

    Declaration
    public ServiceInterceptor()

    Properties

    ActiveServicesCount

    Gets the number of active services.

    Declaration
    public int ActiveServicesCount { get; }
    Property Value
    Type Description
    int

    IsActivated

    Gets a value indicating whether this object is started.

    Declaration
    public virtual bool IsActivated { get; }
    Property Value
    Type Description
    bool

    IsAttached

    Gets a value indicating whether this object is activated.

    Declaration
    public virtual bool IsAttached { get; }
    Property Value
    Type Description
    bool

    IsDestroyed

    Gets a value indicating whether this object is destroyed.

    Declaration
    public virtual bool IsDestroyed { get; }
    Property Value
    Type Description
    bool

    IsStarted

    Gets a value indicating whether this object is started.

    Declaration
    public virtual bool IsStarted { get; }
    Property Value
    Type Description
    bool

    Methods

    InitializeServices()

    Initializes the registered services.

    Declaration
    public void InitializeServices()
    Remarks

    This method initialize only new services, not initialized yet.

    OnInstanced(Service)

    Called every time an instance of a type assignable from Service is instanced by the container.

    Declaration
    protected override void OnInstanced(Service instance)
    Parameters
    Type Name Description
    Service instance

    The generated instance.

    Overrides
    ContainerInterceptor<Service>.OnInstanced(Service)

    OnRegistered(Type)

    Called when a type assignable from is registered in the container.

    Declaration
    public override void OnRegistered(Type type)
    Parameters
    Type Name Description
    Type type

    The registered type.

    Overrides
    ContainerInterceptor.OnRegistered(Type)

    OnUnregistered(Type)

    Called when a type assignable from is unregistered from the container.

    Declaration
    public override void OnUnregistered(Type type)
    Parameters
    Type Name Description
    Type type

    The unregistered type.

    Overrides
    ContainerInterceptor.OnUnregistered(Type)

    UpdateServices(TimeSpan)

    Updates the registered UpdatableService instances.

    Declaration
    public void UpdateServices(TimeSpan gameTime)
    Parameters
    Type Name Description
    TimeSpan gameTime

    The game time.

    Extension Methods

    ReflectionHelper.GetMemberAssembly(object)
    ReflectionHelper.GetTypeName(object)
    In This Article
    Back to top
    Generated by DocFX