-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIProcessContext.cs
More file actions
83 lines (74 loc) · 2.58 KB
/
IProcessContext.cs
File metadata and controls
83 lines (74 loc) · 2.58 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
using System.Runtime.Caching;
using Inversion.Collections;
namespace Inversion.Process {
/// <summary>
/// Provides a processing context as a self-contained and sufficient
/// channel of application execution. The context manages a set of
/// behaviours and mediates between them and the outside world.
/// </summary>
/// <remarks>
/// The process context along with the `IBehaviour` objects registered
/// on its bus *are* Inversion. Everything else is chosen convention about
/// how those behaviours interact with each other via the context.
/// </remarks>
public interface IProcessContext : IContextFor<IControlState> {
/// <summary>
/// Provsion of a simple object cache for the context.
/// </summary>
/// <remarks>
/// This really needs replaced with our own interface
/// that we control. This isn't portable.
/// </remarks>
ObjectCache ObjectCache { get; }
/// <summary>
/// Gives access to a collection of view steps
/// that will be used to control the render
/// pipeline for this context.
/// </summary>
ViewSteps ViewSteps { get; }
/// <summary>
/// Fires an event on the context. Each behaviour registered with context
/// is consulted in no particular order, and for each behaviour that has a condition
/// that returns true when applied to the event, that behaviours action is executed.
/// </summary>
/// <param name="ev">The event to fire on this context.</param>
/// <returns></returns>
IEvent Fire(IEvent ev);
/// <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>
IDataCollection<string> Messages { get; }
/// <summary>
/// Flags for the context available to behaviours as shared state.
/// </summary>
IDataCollection<string> Flags { get; }
/// <summary>
/// The parameters of the contexts execution available
/// to behaviours as shared state.
/// </summary>
IDataDictionary<string> Params { get; }
/// <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>
IDataCollection<ErrorMessage> Errors { get; }
/// <summary>
/// A dictionary of named timers.
/// </summary>
/// <remarks>
/// `ProcessTimer` is only intended
/// for informal timings, and it not intended
/// for proper metrics.
/// </remarks>
ProcessTimerDictionary Timers { get; }
}
}