Interface IContext
Interface for key indexed data holders
Inherited Members
Namespace: Xareus.Scenarios.Context
Assembly: Xareus.Scenarios.dll
Syntax
public interface IContext : ITypeDescriptorContext, IServiceProvider
Methods
Clear()
Clears the context
Declaration
void Clear()
GetPaths()
Lists all the valid paths
Declaration
IEnumerable<string> GetPaths()
Returns
Type | Description |
---|---|
IEnumerable<string> |
GetValue(string)
Get the value in the specified path.
Declaration
object GetValue(string path)
Parameters
Type | Name | Description |
---|---|---|
string | path |
Returns
Type | Description |
---|---|
object | The value at the given path. Fails if the path is incorrect |
GetValueOrDefault(string, object)
Tries to get the value at the given path
Declaration
object GetValueOrDefault(string path, object defaultValue = null)
Parameters
Type | Name | Description |
---|---|---|
string | path | |
object | defaultValue | The value to return if the path is incorrect (default : null) |
Returns
Type | Description |
---|---|
object | The value at the given path if found |
HasPath(string)
Checks that the given path exists
Declaration
bool HasPath(string path)
Parameters
Type | Name | Description |
---|---|---|
string | path |
Returns
Type | Description |
---|---|
bool |
SetValue(string, object)
Changes or sets the value at the given path
Declaration
void SetValue(string path, object value)
Parameters
Type | Name | Description |
---|---|---|
string | path | |
object | value |
Union(string, IContext)
Merges the given context into this one at the given path
Declaration
void Union(string path, IContext other)
Parameters
Type | Name | Description |
---|---|---|
string | path | |
IContext | other |
Union(IContext, bool)
Merges the given context into this one
Declaration
void Union(IContext other, bool overrideDuplicates = true)
Parameters
Type | Name | Description |
---|---|---|
IContext | other | |
bool | overrideDuplicates | Overrides the values in the current object if the same path is found in the givne context |