Server/Slions/Ear/ActionCallback.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 using System.Runtime.Serialization;
     4 
     5 
     6 namespace Slions.Ear
     7 {
     8     [DataContract]
     9     abstract class ActionCallback : Action
    10     {
    11         public delegate void Delegate();
    12 
    13         private readonly Delegate iCallback;
    14 
    15         public ActionCallback(Delegate aCallback = null)
    16         {
    17             iCallback = aCallback;
    18         }
    19 
    20         public override void Execute()
    21         {
    22             if (iCallback != null)
    23             {
    24                 iCallback.Invoke();
    25             }            
    26         }
    27     }
    28 
    29 }