Table of Contents

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

IEnumerable<string>

FilePath

Gets/Sets the import / export file path.

string FilePath { get; set; }

Property Value

string

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

filePath string

Optional. 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

feature string

The feature name.

Returns

T

The feature's value.

Type Parameters

T

The 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

filePath string

Optional. 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

feature string

The feature name.

value T

The feature's new value.

Type Parameters

T

The feature value's type.