Server/Slions/Ear/ActionSleep.cs
author StephaneLenclud
Fri, 22 Jul 2016 18:19:49 +0200
changeset 209 fef4ca058087
permissions -rw-r--r--
Prototype for event and action framework.
     1 //
     2 
     3 
     4 using System.Runtime.Serialization;
     5 using System.Threading;
     6 
     7 namespace Slions.Ear
     8 {
     9     
    10 
    11     [DataContract]
    12     class ActionSleep : Action
    13     {
    14         static readonly string Name = "Sleep";
    15         static readonly string Description = "Have the current thread sleep for the specified amount of milliseconds.";
    16 
    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 }