Beispiel #1
0
        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());
                //}
            }));
        }
Beispiel #2
0
        public virtual void OnSuccess(ThreadHepler oneself)
        {
            if (Success == null)
            {
                return;
            }

            DoMain(new Action(() =>
            {
                try
                {
                    Success(oneself);
                }
                catch (Exception ex)
                {
                    this.Exception = ex;
                    OnError(this);
                }
            }));
        }
Beispiel #3
0
        public virtual void OnFinally(ThreadHepler oneself)
        {
            if (Finally == null)
            {
                return;
            }

            DoMain(new Action(() =>
            {
                try
                {
                    Finally(oneself);
                }
                catch (Exception ex)
                {
                    this.Exception = ex;
                    OnError(this);
                }
            }));
        }