SharpLibEar/ActionSleep.cs
author StephaneLenclud
Sun, 24 Jul 2016 20:36:07 +0200
changeset 214 4961ede27e0a
parent 210 83dd86e73448
child 219 99c407831232
permissions -rw-r--r--
Adding a bunch of CEC actions.
     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 }