StiServiceContainer Class
Namespace: Stimulsoft.Base.Services
Describes class for access to container of services.
Inheritance
Inherits from: CollectionBase
Implements: ICloneable
Constructors
| Constructor | Description |
|---|---|
| StiServiceContainer() | Creates a new object of the type StiServiceContainer. |
StiServiceContainer()
Creates a new object of the type StiServiceContainer.
Properties
| Property | Type | Description |
|---|---|---|
StandardAssemblies static |
string[] |
Methods
| Method | Returns | Description |
|---|---|---|
| Add (+1 overloads) | void | Adds service to the container. |
| AddRange | void | Adds services to the container. |
| Clear | void | Clears all collection from service container. |
| Clone | object | Creates a new object that is a copy of the current instance. |
| Contains (+1 overloads) | bool | |
CreateService static |
StiService | Creates service. |
| GetService (+2 overloads) | StiService | Gets a service type. |
| GetServices (+3 overloads) | StiServiceContainer | Gets all services of the type from the container. |
GetServicesFromAssembly static (+1 overloads) |
StiServiceContainer | Returns services which are in the specified assembly. |
GetServicesNamesFromAssembly static |
ArrayList | |
GetStandardServices static |
StiServiceContainer | Gets a service container that contains all standard services. |
GetStandardServicesNames static |
ArrayList | |
GetStringFromService static (+1 overloads) |
string | Returns string presentation of the service. |
| IndexOf | int | |
| Insert | void | |
| Load (+2 overloads) | void | Loads container of services. |
| Remove (+2 overloads) | void | Removes services of the type from the container. |
| Save (+2 overloads) | void | Saves container of services. |
| ToArray | StiService[] | Gets array of services, that contains in this service container. |
| ToList (+1 overloads) | List |
Method Details
Add
Add(service: StiService): void
Adds service to the container.
Parameters
- service (StiService) — Service.
Add(service: StiService, callBeforeGetService: bool): void
Adds service to the container.
Parameters
- service (StiService) — Service.
- callBeforeGetService (bool)
AddRange
AddRange(services: StiServiceContainer): void
Adds services to the container.
Parameters
- services (StiServiceContainer) — Services.
Clear
Clear(): void
Clears all collection from service container.
Clone
Clone(): object
Creates a new object that is a copy of the current instance.
Returns object — A new object that is a copy of this instance.
Contains
Contains(service: StiService): bool
Parameters
- service (StiService)
Returns bool
Contains(service: string): bool
Parameters
- service (string)
Returns bool
CreateService static
CreateService(assemblyName: string, type: string): StiService
Creates service.
Parameters
- assemblyName (string) — Assembly where the service is.
- type (string) — Service type.
Returns StiService — Created service.
GetService
GetService(serviceType: Type): StiService
Gets a service type.
Parameters
- serviceType (Type)
Returns StiService
GetService(serviceType: Type, getEnabled: bool): StiService
Parameters
- serviceType (Type)
- getEnabled (bool)
Returns StiService
GetService(serviceType: Type, getEnabled: bool, callBeforeGetService: bool): StiService
Gets first service of the type from the container.
Parameters
- serviceType (Type) — Service type.
- getEnabled (bool)
- callBeforeGetService (bool)
Returns StiService — Service.
GetServices
GetServices(serviceType: Type): StiServiceContainer
Gets all services of the type from the container.
Parameters
- serviceType (Type) — Type of the returnable services.
Returns StiServiceContainer — Collection of services.
GetServices(): List
Returns List
GetServices(serviceType: Type, getEnabled: bool): StiServiceContainer
Parameters
- serviceType (Type)
- getEnabled (bool)
Returns StiServiceContainer
GetServices(serviceType: Type, getEnabled: bool, callBeforeGetService: bool): StiServiceContainer
Returns all services of the type from the container.
Parameters
- serviceType (Type) — Type of the returnable services.
- getEnabled (bool) — If true then returns only enabled services.
- callBeforeGetService (bool)
Returns StiServiceContainer — Collection of services.
GetServicesFromAssembly static
GetServicesFromAssembly(assemblyName: string): StiServiceContainer
Returns services which are in the specified assembly.
Parameters
- assemblyName (string) — Assembly.
Returns StiServiceContainer — Services.
GetServicesFromAssembly(a: Assembly): StiServiceContainer
Returns services which are in the specified assembly.
Parameters
- a (Assembly) — Assembly.
Returns StiServiceContainer — Services.
GetServicesNamesFromAssembly static
GetServicesNamesFromAssembly(a: Assembly): ArrayList
Parameters
- a (Assembly)
Returns ArrayList
GetStandardServices static
GetStandardServices(): StiServiceContainer
Gets a service container that contains all standard services.
Returns StiServiceContainer — Service container that contains all standard services.
GetStandardServicesNames static
GetStandardServicesNames(): ArrayList
Returns ArrayList
GetStringFromService static
GetStringFromService(service: StiService): string
Returns string presentation of the service.
Parameters
- service (StiService) — Service.
Returns string — String.
GetStringFromService(serviceType: Type): string
Parameters
- serviceType (Type)
Returns string
IndexOf
IndexOf(service: StiService): int
Parameters
- service (StiService)
Returns int
Insert
Insert(index: int, service: StiService): void
Parameters
- index (int)
- service (StiService)
Load
Load(tr: XmlReader): void
Loads container of services.
Parameters
- tr (XmlReader) — XmlReader.
Load(stream: Stream): void
Loads container of services.
Parameters
- stream (Stream) — Stream.
Load(fileName: string): void
Loads container of services.
Parameters
- fileName (string) — File.
Remove
Remove(serviceType: Type): void
Removes services of the type from the container.
Parameters
- serviceType (Type) — Service type.
Remove(service: StiService): void
Removes service from the container.
Parameters
- service (StiService) — Service.
Remove(services: StiServiceContainer): void
Removes service from the container.
Parameters
- services (StiServiceContainer) — Services.
Save
Save(tw: XmlWriter): void
Saves container of services.
Parameters
- tw (XmlWriter) — XmlWriter.
Save(stream: Stream): void
Saves container of services.
Parameters
- stream (Stream) — Stream.
Save(fileName: string): void
Saves container of services.
Parameters
- fileName (string) — File.
ToArray
ToArray(): StiService[]
Gets array of services, that contains in this service container.
Returns StiService[]
ToList
ToList(): List
Returns List
ToList(): List<StiService>
Returns List<StiService>
Events
| Event | Type | Description |
|---|---|---|
| BeforeGetService | StiServiceActionHandler |