Skip to content

T_CodeJam_Services_ServiceContainer

Andrew Koryavchenko edited this page Jun 17, 2018 · 5 revisions

ServiceContainer Class

Service container.

Inheritance Hierarchy

System.Object
  CodeJam.Services.ServiceContainer
Namespace: CodeJam.Services
Assembly: CodeJam.Blocks (in CodeJam.Blocks.dll) Version: 2.0.0.0

Syntax

C#

public class ServiceContainer : IServicePublisher, 
	IServiceProvider, IDisposable

VB

Public Class ServiceContainer
	Implements IServicePublisher, IServiceProvider, IDisposable

F#

type ServiceContainer =  
    class
        interface IServicePublisher
        interface IServiceProvider
        interface IDisposable
    end

The ServiceContainer type exposes the following members.

Constructors

 

Name Description
Public method ServiceContainer(Boolean) Initializes a new instance of the Object class.
Public method ServiceContainer(IServiceProvider, Boolean) Initializes a new instance of the Object class.
  Back to Top

Methods

 

Name Description
Public method Dispose Calls Dispose() methods in all created service instances, that implements IDisposable.
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method GetService Gets the service object of the specified type.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method Publish(Type, Func(IServicePublisher, Object)) Publish service.
Public method Publish(Type, Object) Publish service.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
  Back to Top

Extension Methods

 

Name Description
Public Extension Method GetRequiredService(Type) Overloaded.
Gets the service object of the specified type, or throws an exception if service not registered. (Defined by ServiceProviderHelper.)
Public Extension Method GetRequiredService(T)() Overloaded.
Gets the service object of the specified type, or throws an exception if service not registered. (Defined by ServiceProviderHelper.)
Public Extension Method GetService(T) Gets the service object of the specified type. (Defined by ServiceProviderHelper.)
Public Extension Method Publish(T)(T) Overloaded.
Publish service. (Defined by ServiceProviderHelper.)
Public Extension Method Publish(T)(Func(IServicePublisher, T)) Overloaded.
Publish service. (Defined by ServiceProviderHelper.)
  Back to Top

See Also

Reference

CodeJam.Services Namespace

Clone this wiki locally