Class Factory<T1, T2>
Factory for creating objects of BuildSystem.FileCopier
Inheritance
Namespace: BuildSystem.Factories
Assembly: BuildSystem.Factories.dll
Syntax
public class Factory<T1, T2> : Object where T1 : IManager where T2 : IManagerProp
Type Parameters
Name | Description |
---|---|
T1 | |
T2 |
Constructors
Factory()
Declaration
public Factory()
Methods
Clear()
Clean all registered units in factory
Declaration
public void Clear()
CreateObject(IManagerProp, ILogger?, string)
Create instance of propObject when properties already exists
Declaration
public T1 CreateObject(IManagerProp propObject, ILogger? logger, string tempDir)
Parameters
Type | Name | Description |
---|---|---|
IManagerProp | propObject | Properties for creating object |
ILogger | logger | Logging object |
string | tempDir | Path to folder where temporary folders can be created |
Returns
Type | Description |
---|---|
T1 |
CreateObject(string, JsonNode?, string, ILogger?, string, IManagerProp?)
Create instance of object when json object doesn't contain ident of creating class
Declaration
public T1 CreateObject(string className, JsonNode? jsonInfo, string relativeDir, ILogger? logger, string tempDir, IManagerProp? defaultProps = null)
Parameters
Type | Name | Description |
---|---|---|
string | className | Name of class of creating object |
System.Text.Json.Nodes.JsonNode | jsonInfo | JsonObject with properties |
string | relativeDir | A directory which should be added to properties containing relative paths |
ILogger | logger | Logging object |
string | tempDir | Path to folder where temporary folders can be created |
IManagerProp | defaultProps | Default properties for creating object |
Returns
Type | Description |
---|---|
T1 |
CreateProps(string, JsonNode?, string, IManagerProp?)
Create instance of objectProps when json object doesn't contain ident of creating class
Declaration
public T2 CreateProps(string className, JsonNode? jsonInfo, string relativeDir, IManagerProp? defaultProps = null)
Parameters
Type | Name | Description |
---|---|---|
string | className | Name of class of creating object |
System.Text.Json.Nodes.JsonNode | jsonInfo | JsonObject with properties |
string | relativeDir | A directory which should be added to properties containing relative paths |
IManagerProp | defaultProps | Default properties for creating object |
Returns
Type | Description |
---|---|
T2 |
CreateProps(JsonNode?, string, IManagerProp?)
Create instance of objectProps when ident of creating class is stored in json
Declaration
public T2? CreateProps(JsonNode? jsonInfo, string relativeDir, IManagerProp? defaultProps = null)
Parameters
Type | Name | Description |
---|---|---|
System.Text.Json.Nodes.JsonNode | jsonInfo | JsonObject with only one key - ident of class |
string | relativeDir | Directory which should be added to properties containing relative paths |
IManagerProp | defaultProps | Default properties for creating object |
Returns
Type | Description |
---|---|
T2 | New instance of object |
RegisterAssembly<T3, T4>()
Add accordance of classname and int location (assembly) so instance of class can be created later
Declaration
public void RegisterAssembly<T3, T4>() where T3 : T1 where T4 : T2
Type Parameters
Name | Description |
---|---|
T3 | Registering class of manager object |
T4 | Registering class of properties of manager object |