SharpLibEar/ActionSleep.cs
author StephaneLenclud
Sat, 23 Jul 2016 16:00:04 +0200
changeset 210 83dd86e73448
child 212 1a0791daa243
permissions -rw-r--r--
Most basic event action manager.
     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         private readonly int iMillisecondsTimeout;
    17 
    18         public ActionSleep()
    19         {
    20             iMillisecondsTimeout = 1000;
    21         }
    22 
    23 
    24         public ActionSleep(int aMillisecondsTimeout)
    25         {
    26             iMillisecondsTimeout = aMillisecondsTimeout;
    27         }
    28 
    29         public override void Execute()
    30         {
    31             Thread.Sleep(iMillisecondsTimeout);
    32         }
    33 
    34     }
    35 
    36 
    37 
    38 }