Class DIContainer
A very simple container for getting references to dependencies in a similar way a component would get references to other components.
Namespace: InsaneScatterbrain.RetroKit.Editor
Syntax
public class DIContainer
Methods
Get<T>()
Get object by type.
Declaration
public T Get<T>()
where T : class
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T | The object type. |
Get<T>(String)
Get object by name.
Declaration
public T Get<T>(string name)
where T : class
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The object's name. |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T | The object's type. |
Register(String, Object)
Register object by name.
Declaration
public void Register(string name, object instance)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Name of the object. |
| System.Object | instance | Instance of the object. |
Register<TBase>(Object)
Register object by type.
Declaration
public void Register<TBase>(object instance)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | instance | Instance of object. |
Type Parameters
| Name | Description |
|---|---|
| TBase | Type of the object. |
UnRegister(String)
Unregister object by name.
Declaration
public void UnRegister(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The name of the object. |
UnRegister<TBase>()
Unregister object of a type.
Declaration
public void UnRegister<TBase>()
Type Parameters
| Name | Description |
|---|---|
| TBase | Type of object. |