private void OnAfterPlugInRun(object sender, ChoPlugInRunEventArgs e) { AfterPlugInRun.Raise(sender, e); }
public object Run(object value) { try { if (Enabled) { ChoPlugInRunEventArgs e = new ChoPlugInRunEventArgs() { Value = value, IsLastPlugIn = Next == null }; _beforeRun.Raise(this, e); if (e.Cancel) { return(e.Value); } value = e.Value; if (_stopRequested) { throw new ChoPlugInStopRequestedException(); } bool cancel = false; Validate(); value = Execute(value, out cancel); if (cancel) { return(value); } e = new ChoPlugInRunEventArgs() { Value = value, IsLastPlugIn = Next == null }; _afterRun.Raise(this, e); if (cancel) { return(e.Value); } value = e.Value; } if (Next != null) { return(Next.Run(value)); } else { return(value); } } finally { if (Enabled) { CleanUp(); } } }
private void OnBeforePlugInRun(object sender, ChoPlugInRunEventArgs e) { ActivePlugIn = sender as ChoPlugIn; BeforePlugInRun.Raise(sender, e); }