1
//
2
3
4
using System.Runtime.Serialization;
5
using System.Threading;
6
7
8
namespace SharpLib.Ear
9
{
10
11
12
[DataContract]
13
[AttributeAction(Id = "Thread.Sleep", Name = "Sleep", Description = "Have the current thread sleep for the specified amount of milliseconds.")]
14
public class ActionSleep : Action
15
16
[DataMember]
17
private readonly int iMillisecondsTimeout;
18
19
public ActionSleep()
20
21
iMillisecondsTimeout = 1000;
22
}
23
24
25
public ActionSleep(int aMillisecondsTimeout)
26
27
iMillisecondsTimeout = aMillisecondsTimeout;
28
29
30
public override void Execute()
31
32
Thread.Sleep(iMillisecondsTimeout);
33
34
35
36
37
38
39