Class ServiceInterceptor
Inherited Members
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 were 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 has started.
Declaration
public virtual bool IsActivated { get; }
Property Value
Type | Description |
---|---|
bool |
IsAttached
Gets a value indicating whether this object is active.
Declaration
public virtual bool IsAttached { get; }
Property Value
Type | Description |
---|---|
bool |
IsDestroyed
Gets a value indicating whether this object has been destroyed.
Declaration
public virtual bool IsDestroyed { get; }
Property Value
Type | Description |
---|---|
bool |
IsStarted
Gets a value indicating whether this object has 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 initializes only new services that have not been initialized yet.
OnInstanced(Service)
Called every time an instance of a type assignable from Service is instantiated by the container.
Declaration
protected override void OnInstanced(Service instance)
Parameters
Type | Name | Description |
---|---|---|
Service | instance | The generated instance. |
Overrides
OnRegistered(Type)
Called when a type assignable from
Declaration
public override void OnRegistered(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type that is registered. |
Overrides
OnUnregistered(Type)
Called when a type assignable from
Declaration
public override void OnUnregistered(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type that was unregistered. |
Overrides
UpdateServices(TimeSpan)
Updates the registered UpdatableService instances.
Declaration
public void UpdateServices(TimeSpan gameTime)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | gameTime | The game time. |