-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathControlState.cs
More file actions
49 lines (44 loc) · 1.53 KB
/
ControlState.cs
File metadata and controls
49 lines (44 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using Inversion.Collections;
namespace Inversion.Process {
/// <summary>
/// Implements a common working control state.
/// </summary>
public class ControlState : DataDictionary<object>, IControlState {
/// <summary>
/// Messages intended for user feedback.
/// </summary>
/// <remarks>
/// This is a poor mechanism for localisation,
/// and may need to be treated as tokens
/// by the front end to localise.
/// </remarks>
public IDataCollection<string> Messages { get; } = new DataCollection<string>();
/// <summary>
/// Error messages intended for user feedback.
/// </summary>
/// <remarks>
/// This is a poor mechanism for localisation,
/// and may need to be treated as tokens
/// by the front end to localise.
/// </remarks>
public IDataCollection<ErrorMessage> Errors { get; } = new DataCollection<ErrorMessage>();
/// <summary>
/// A dictionary of named timers.
/// </summary>
/// <remarks>
/// `ProcessTimer` is only intended
/// for informal timings, and it not intended
/// for proper metrics.
/// </remarks>
public ProcessTimerDictionary Timers { get; } = new ProcessTimerDictionary();
/// <summary>
/// Flags for the context available to behaviours as shared state.
/// </summary>
public IDataCollection<string> Flags { get; } = new DataCollection<string>();
/// <summary>
/// The parameters of the contexts execution available
/// to behaviours as shared state.
/// </summary>
public IDataDictionary<string> Params { get; } = new ConcurrentDataDictionary<string>();
}
}