1 | using System;
|
---|
2 | namespace Netron.Diagramming.Core {
|
---|
3 | // ----------------------------------------------------------------------
|
---|
4 | /// <summary>
|
---|
5 | /// This defines what an action or activity is on the diagram, which can
|
---|
6 | /// be a data manipulation or layout or an asynchronuous dump of data.
|
---|
7 | /// </summary>
|
---|
8 | // ----------------------------------------------------------------------
|
---|
9 | public interface IActivity {
|
---|
10 | // In the final analysis, your understanding of how to do construction
|
---|
11 | // determines how good a programmer you are.
|
---|
12 |
|
---|
13 | #region Events
|
---|
14 | /// <summary>
|
---|
15 | ///
|
---|
16 | /// </summary>
|
---|
17 | event EventHandler OnActivityRun;
|
---|
18 |
|
---|
19 | #endregion
|
---|
20 |
|
---|
21 | #region Properties
|
---|
22 | /// <summary>
|
---|
23 | /// Gets or sets a value indicating whether this <see cref="T:IActivity"/> is enabled.
|
---|
24 | /// </summary>
|
---|
25 | /// <value><c>true</c> if enabled; otherwise, <c>false</c>.</value>
|
---|
26 | bool Enabled { get; set; }
|
---|
27 | /// <summary>
|
---|
28 | /// Gets or sets the step time.
|
---|
29 | /// </summary>
|
---|
30 | /// <value>The step time.</value>
|
---|
31 | TimeSpan StepTime { get; set; }
|
---|
32 | /// <summary>
|
---|
33 | /// Gets or sets the start time.
|
---|
34 | /// </summary>
|
---|
35 | /// <value>The start time.</value>
|
---|
36 | DateTime StartTime { get; set; }
|
---|
37 | /// <summary>
|
---|
38 | /// Gets the duration of the activity.
|
---|
39 | /// </summary>
|
---|
40 | /// <value>The duration.</value>
|
---|
41 | TimeSpan Duration { get; }
|
---|
42 | /// <summary>
|
---|
43 | /// Gets the name.
|
---|
44 | /// </summary>
|
---|
45 | /// <value>The name.</value>
|
---|
46 | string Name { get; }
|
---|
47 |
|
---|
48 | #endregion
|
---|
49 |
|
---|
50 | #region Methods
|
---|
51 | /// <summary>
|
---|
52 | /// Runs the activity
|
---|
53 | /// </summary>
|
---|
54 | void Run();
|
---|
55 |
|
---|
56 | /// <summary>
|
---|
57 | /// Runs the specified time.
|
---|
58 | /// </summary>
|
---|
59 | /// <param name="time">The time.</param>
|
---|
60 | void Run(int time);
|
---|
61 |
|
---|
62 | /// <summary>
|
---|
63 | /// Runs the after.
|
---|
64 | /// </summary>
|
---|
65 | /// <param name="firstActivity">The first activity.</param>
|
---|
66 | void RunAfter(IActivity firstActivity);
|
---|
67 |
|
---|
68 | /// <summary>
|
---|
69 | /// Stops this instance.
|
---|
70 | /// </summary>
|
---|
71 | void Stop();
|
---|
72 |
|
---|
73 | #endregion
|
---|
74 | }
|
---|
75 | }
|
---|