Last change
on this file since 3757 was
2768,
checked in by mkommend, 14 years ago
|
added solution folders and sources for the netron library (ticket #867)
|
File size:
1.9 KB
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Text;
|
---|
4 |
|
---|
5 | namespace Netron.Diagramming.Core
|
---|
6 | {
|
---|
7 | abstract class ActivityBase : IActivity
|
---|
8 | {
|
---|
9 | #region Events
|
---|
10 | public event EventHandler OnActivityRun;
|
---|
11 | #endregion
|
---|
12 |
|
---|
13 | #region Fields
|
---|
14 | private bool mEnabled;
|
---|
15 | private TimeSpan mStepTime = new TimeSpan(0,0,80);
|
---|
16 | private DateTime mStartTime = DateTime.Now;
|
---|
17 | private string mName;
|
---|
18 | #endregion
|
---|
19 |
|
---|
20 | #region Properties
|
---|
21 | public string Name
|
---|
22 | {
|
---|
23 | get { return mName; }
|
---|
24 | }
|
---|
25 | public bool Enabled
|
---|
26 | {
|
---|
27 | get
|
---|
28 | {
|
---|
29 | return mEnabled;
|
---|
30 | }
|
---|
31 | set
|
---|
32 | {
|
---|
33 | mEnabled = value;
|
---|
34 | }
|
---|
35 | }
|
---|
36 |
|
---|
37 | public TimeSpan StepTime
|
---|
38 | {
|
---|
39 | get
|
---|
40 | {
|
---|
41 | return mStepTime;
|
---|
42 | }
|
---|
43 | set
|
---|
44 | {
|
---|
45 | mStepTime = value;
|
---|
46 | }
|
---|
47 | }
|
---|
48 |
|
---|
49 | public DateTime StartTime
|
---|
50 | {
|
---|
51 | get
|
---|
52 | {
|
---|
53 | return mStartTime;
|
---|
54 | }
|
---|
55 | set
|
---|
56 | {
|
---|
57 | mStartTime = value;
|
---|
58 | }
|
---|
59 | }
|
---|
60 |
|
---|
61 | public TimeSpan Duration
|
---|
62 | {
|
---|
63 | get
|
---|
64 | {
|
---|
65 |
|
---|
66 | return mStepTime;
|
---|
67 | }
|
---|
68 | }
|
---|
69 | #endregion
|
---|
70 | protected ActivityBase(string name){ mName = name;}
|
---|
71 |
|
---|
72 | public abstract void Run();
|
---|
73 |
|
---|
74 | public abstract void Run(int time);
|
---|
75 |
|
---|
76 | public void RunAfter(IActivity firstActivity)
|
---|
77 | {
|
---|
78 | throw new NotImplementedException("The method or operation is not implemented.");
|
---|
79 | }
|
---|
80 |
|
---|
81 | public abstract void Stop();
|
---|
82 |
|
---|
83 | protected void RaiseOnActivityRun()
|
---|
84 | {
|
---|
85 | if (OnActivityRun != null)
|
---|
86 | OnActivityRun(this, EventArgs.Empty);
|
---|
87 | }
|
---|
88 | }
|
---|
89 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.