Class ModelStore<T>
Stores code factory models so they can be extracted when needed.
Inherited Members
Namespace: CodeFactory
Assembly: CodeFactory.dll
Syntax
public class ModelStore<T> where T : class
Type Parameters
Name | Description |
---|---|
T | The type of model that is being stored. |
Constructors
| Improve this Doc View SourceModelStore()
Initialization of the model store
Declaration
public ModelStore()
Methods
| Improve this Doc View SourceAddModel(string, T)
Adds a model to the model store.
Declaration
public void AddModel(string index, T model)
Parameters
Type | Name | Description |
---|---|---|
string | index | The unique index for the model. |
T | model | The model to be added to the store. The model cannot be null otherwise it will not be added. |
GetModel(string)
Gets a target model from the store.
Declaration
public T GetModel(string index)
Parameters
Type | Name | Description |
---|---|---|
string | index | Index number of the model to load. |
Returns
Type | Description |
---|---|
T | The stored model or null if the model could not be returned. |
Remarks
Thread safe operation.