Class Environment
This stands for the environment in which the scenario engine operates. The register references all the relations and all the relational objects. It stores every executed realizations and those that need to be executed.
Inherited Members
Namespace: Xareus.Scenarios.Relations
Assembly: Xareus.Scenarios.Relations.dll
Syntax
public class Environment : IContext, ITypeDescriptorContext, IServiceProvider, IRealizationManager
Constructors
Environment(IEngine)
Declaration
public Environment(IEngine engine)
Parameters
Type | Name | Description |
---|---|---|
IEngine | engine |
Fields
RELATION_ENGINE_PATH
Declaration
public const string RELATION_ENGINE_PATH = "RelationEngine"
Field Value
Type | Description |
---|---|
string |
subContexts
Declaration
protected List<IContext> subContexts
Field Value
subContextsInPath
Declaration
protected Dictionary<string, List<IContext>> subContextsInPath
Field Value
Type | Description |
---|---|
Dictionary<string, List<IContext>> |
Properties
Container
Gets the container representing this Type
Declaration
public virtual IContainer Container { get; }
Property Value
Type | Description |
---|---|
IContainer | An System. |
Instance
Gets the object that is connected with this type descriptor request.
Declaration
public virtual object Instance { get; }
Property Value
Type | Description |
---|---|
object | The object that invokes the method on the Type |
Objects
Declaration
public Dictionary<string, IObject> Objects { get; }
Property Value
Type | Description |
---|---|
Dictionary<string, IObject> |
PropertyDescriptor
Gets the System.
Declaration
public virtual PropertyDescriptor PropertyDescriptor { get; }
Property Value
Type | Description |
---|---|
Property |
The System. |
RelationEngine
The relation engine linked to this environment
Declaration
public IEngine RelationEngine { get; }
Property Value
Type | Description |
---|---|
IEngine |
Relations
Declaration
public Dictionary<string, IRelation> Relations { get; }
Property Value
Type | Description |
---|---|
Dictionary<string, IRelation> |
Methods
AddExecutedRealization(Realization)
Add the given realization to the log.
Declaration
public void AddExecutedRealization(Realization realization)
Parameters
Type | Name | Description |
---|---|---|
Realization | realization |
AddSubContext(IContext)
Add a sub-context that will be browsed when accessing values
Declaration
public void AddSubContext(IContext subContext)
Parameters
Type | Name | Description |
---|---|---|
IContext | subContext |
AddSubContext(IContext, string)
Add a sub-context that will be browsed when accessing values
Declaration
public void AddSubContext(IContext subContext, string path)
Parameters
Clear()
Declaration
public void Clear()
EnqueueRealizationToExecute(Realization)
Add the given realization to the backlog.
Declaration
public void EnqueueRealizationToExecute(Realization realization)
Parameters
Type | Name | Description |
---|---|---|
Realization | realization |
GetExecutedRealizations(IRelation, HashSet<IObject>, DateTime, DateTime)
Returns every realization that match the given relation and objects and that were created between the start and end DateTime.
Declaration
public IEnumerable<Realization> GetExecutedRealizations(IRelation relation, HashSet<IObject> objects, DateTime start, DateTime end)
Parameters
Returns
Type | Description |
---|---|
IEnumerable<Realization> |
GetNextRealizationToExecute()
Returns the oldest realization in the backlog.
Declaration
public Realization GetNextRealizationToExecute()
Returns
Type | Description |
---|---|
Realization |
GetPaths()
Lists all the valid paths
Declaration
public IEnumerable<string> GetPaths()
Returns
Type | Description |
---|---|
IEnumerable<string> |
GetService(Type)
Gets the service object of the specified type.
Declaration
public virtual object GetService(Type serviceType)
Parameters
Type | Name | Description |
---|---|---|
Type | serviceType | An object that specifies the type of service object to get. |
Returns
Type | Description |
---|---|
object | A service object of type |
GetValue(string)
Get the first value at the given path in the environment or one of its sub contexts
Declaration
public object GetValue(string path)
Parameters
Type | Name | Description |
---|---|---|
string | path |
Returns
Type | Description |
---|---|
object |
GetValueOrDefault(string, object)
Get the first value at the given path in the environment or one of its sub contexts or the given default value if not found
Declaration
public object GetValueOrDefault(string path, object defaultValue = null)
Parameters
Returns
Type | Description |
---|---|
object |
HasPath(string)
Checks if the given path exists in the environment or on of its sub contexts
Declaration
public bool HasPath(string path)
Parameters
Type | Name | Description |
---|---|---|
string | path |
Returns
Type | Description |
---|---|
bool |
HasSubContext(IContext, bool)
Check if a sub-context is present in the Environment
Declaration
public bool HasSubContext(IContext subContext, bool atAnyPath = true)
Parameters
Returns
Type | Description |
---|---|
bool |
OnComponentChanged()
Raises the Component
Declaration
public virtual void OnComponentChanged()
OnComponentChanging()
Raises the Component
Declaration
public virtual bool OnComponentChanging()
Returns
RemoveSubContext(IContext, bool)
Remove a sub-context
Declaration
public void RemoveSubContext(IContext subContext, bool atAnyPath = true)
Parameters
SetValue(string, object)
Sets the value at the given path in the environment (note that sub contexts won't be affected)
Declaration
public void SetValue(string path, object value)
Parameters
Union(string, IContext)
Merges the given context into this one at the given path
Declaration
public void Union(string path, IContext other)
Parameters
Union(IContext, bool)
Declaration
public void Union(IContext other, bool overrideDuplicates = true)