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