StephaneLenclud@210: // StephaneLenclud@210: StephaneLenclud@210: StephaneLenclud@210: using System.Runtime.Serialization; StephaneLenclud@210: using System.Threading; StephaneLenclud@210: StephaneLenclud@210: StephaneLenclud@210: namespace SharpLib.Ear StephaneLenclud@210: { StephaneLenclud@210: StephaneLenclud@210: StephaneLenclud@210: [DataContract] StephaneLenclud@210: [AttributeAction(Id = "Thread.Sleep", Name = "Sleep", Description = "Have the current thread sleep for the specified amount of milliseconds.")] StephaneLenclud@210: public class ActionSleep : Action StephaneLenclud@210: { Stephane@212: [DataMember] StephaneLenclud@210: private readonly int iMillisecondsTimeout; StephaneLenclud@210: StephaneLenclud@210: public ActionSleep() StephaneLenclud@210: { StephaneLenclud@210: iMillisecondsTimeout = 1000; StephaneLenclud@210: } StephaneLenclud@210: StephaneLenclud@210: StephaneLenclud@210: public ActionSleep(int aMillisecondsTimeout) StephaneLenclud@210: { StephaneLenclud@210: iMillisecondsTimeout = aMillisecondsTimeout; StephaneLenclud@210: } StephaneLenclud@210: StephaneLenclud@210: public override void Execute() StephaneLenclud@210: { StephaneLenclud@210: Thread.Sleep(iMillisecondsTimeout); StephaneLenclud@210: } StephaneLenclud@210: StephaneLenclud@210: } StephaneLenclud@210: StephaneLenclud@210: StephaneLenclud@210: StephaneLenclud@210: }