StephaneLenclud@210: // StephaneLenclud@210: StephaneLenclud@210: using System.Runtime.Serialization; StephaneLenclud@258: using System.Threading.Tasks; StephaneLenclud@210: StephaneLenclud@210: namespace SharpLib.Ear StephaneLenclud@210: { StephaneLenclud@210: [DataContract] StephaneLenclud@210: public abstract class ActionCallback : Action StephaneLenclud@210: { StephaneLenclud@210: public delegate void Delegate(); StephaneLenclud@210: StephaneLenclud@210: private readonly Delegate iCallback; StephaneLenclud@210: StephaneLenclud@210: public ActionCallback(Delegate aCallback = null) StephaneLenclud@210: { StephaneLenclud@210: iCallback = aCallback; StephaneLenclud@210: } StephaneLenclud@210: StephaneLenclud@258: protected override async Task DoExecute() StephaneLenclud@210: { StephaneLenclud@210: if (iCallback != null) StephaneLenclud@210: { StephaneLenclud@210: iCallback.Invoke(); StephaneLenclud@210: } StephaneLenclud@210: } StephaneLenclud@210: } StephaneLenclud@210: StephaneLenclud@210: }