public virtual void OnError(ThreadHepler oneself) { if (Error == null) { return; } DoMain(new Action(() => { Error(oneself); //if (IsShowMessage && oneself.Exception != null) //{ // System.Windows.Forms.MessageBox.Show(oneself.Exception.ToString()); //} })); }
public virtual void OnSuccess(ThreadHepler oneself) { if (Success == null) { return; } DoMain(new Action(() => { try { Success(oneself); } catch (Exception ex) { this.Exception = ex; OnError(this); } })); }
public virtual void OnFinally(ThreadHepler oneself) { if (Finally == null) { return; } DoMain(new Action(() => { try { Finally(oneself); } catch (Exception ex) { this.Exception = ex; OnError(this); } })); }