public static dynamic Func(MyAction4 myAction, ref ErrorInfo err, ApiPagingDataBean <outT> inEnt) { try { return(myAction(ref err, inEnt)); } catch (Exception e) { err.IsError = true; err.Message = e.Message; return(err); } }
public void InvokeAll() { MyEvent1(this, EventArgs.Empty); MyEvent2.Invoke(this, EventArgs.Empty); MyEvent3.DynamicInvoke(this, EventArgs.Empty); MyEvent4.BeginInvoke(this, EventArgs.Empty, null, null); this.MyEvent5(this, EventArgs.Empty); MyEvent6?.Invoke(this, EventArgs.Empty); MyAction1(this, EventArgs.Empty); MyAction2.Invoke(this, EventArgs.Empty); MyAction3.DynamicInvoke(this, EventArgs.Empty); MyAction4.BeginInvoke(this, EventArgs.Empty, null, null); this.MyAction5(this, EventArgs.Empty); MyAction6?.Invoke(this, EventArgs.Empty); }