예제 #1
0
        public void Start(LeaveToObserveEngineViewModel viewModel)
        {
            _viewModel = viewModel;

            this.RefreshLoad();

            time.Start();
        }
예제 #2
0
        /// <summary> 执行工作流 </summary>
        public void DoWork(string str, LeaveToObserveEngineViewModel viewModel)
        {
            _viewModel = viewModel;

            string err;

            if (flag)
            {
                MessageProvider.Instance.ShowWithLog("正在处理,请稍等!");
                return;
            }

            lock (_lock)
            {
                flag = true;


                try
                {
                    ChildInfo child = this.GetChild(str, out err);

                    if (child == null)
                    {
                        MessageProvider.Instance.ShowWithLog(err);
                        return;
                    }
                    else
                    {
                        MessageProvider.Instance.ShowWithLog(err, 3);

                        this._viewModel.AddMessage(err);

                        //刷新列表
                        this.RefreshLoad();
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                finally
                {
                    flag = false;
                }
            }
        }