SharpLibEar/ActionCallback.cs
author StephaneLenclud
Thu, 25 Aug 2016 13:12:54 +0200
changeset 254 181323a59047
parent 223 f6272f65d8fc
child 258 e237c2e33545
permissions -rw-r--r--
Published v1.0.1.0.
Updating Harmony library to v0.5.0
     1 //
     2 
     3 using System.Runtime.Serialization;
     4 
     5 
     6 namespace SharpLib.Ear
     7 {
     8     [DataContract]
     9     public 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         protected override void DoExecute()
    21         {
    22             if (iCallback != null)
    23             {
    24                 iCallback.Invoke();
    25             }            
    26         }
    27     }
    28 
    29 }