Interface IBehaviorService
- Namespace
- Csra.Interfaces
- Assembly
- Csra.dll
public interface IBehaviorService : IServiceBase
- Inherited Members
Properties
Features
Gets a collection containing all defined features.
IEnumerable<string> Features { get; }
Property Value
FilePath
Gets/Sets the import / export file path.
string FilePath { get; set; }
Property Value
Methods
Export(string)
Writes all features to the specified file, or a previously defined FilePath if empty. Updates the FilePath setting.
void Export(string filePath = "")
Parameters
filePathstringOptional. The (relative or absolute) file path.
GetFeature<T>(string)
Reads a feature's value. Type must match the original definition, an exception is thrown otherwise.
T GetFeature<T>(string feature)
Parameters
featurestringThe feature name.
Returns
- T
The feature's value.
Type Parameters
TThe feature value's type.
Import(string)
Reads the specified file, or a previously defined FilePath if empty. Incrementally updates features with new values.
Call Services.Behavior.Reset() to clear all data first. Updates the FilePath setting.
void Import(string filePath = "")
Parameters
filePathstringOptional. The (relative or absolute) file path.
SetFeature<T>(string, T)
Defines a feature's value. Creates a new entry, or updates an existing one if it already exists.
void SetFeature<T>(string feature, T value)
Parameters
featurestringThe feature name.
valueTThe feature's new value.
Type Parameters
TThe feature value's type.