Exemplo n.º 1
0
        private void runCase(IEnumerable <RecordStep> steps, bool runWithP = false)
        {
            WorkingEventArgs ae = new WorkingEventArgs();

            ae.IsProcessKnow = true;
            ae.Current       = 0;

            int round = 1;

            if (runWithP)
            {
                round = _parameterTable.Rows.Count;
            }
            ae.Max = steps.Count() * round;
            for (int i = 0; i < round; i++)
            {
                foreach (var step in steps)
                {
                    ae.Current += 1;
                    if (runWithP && step.IsParameterize)
                    {
                        DataRow dr = _parameterTable.Rows[i];
                        foreach (var p in step.ActionParams)
                        {
                            p.Value = dr[p.Name];
                        }
                    }
                    SAPAutomationHelper.Current.RunAction(step);
                    if (OnWorking != null)
                    {
                        OnWorking(this, ae);
                    }
                }
            }
        }
Exemplo n.º 2
0
        void c_OnWorking(object sender, WorkingEventArgs e)
        {
            this.Dispatcher.BeginInvoke(new Action(() => {
                if (this.IsEnabled)
                {
                    this.IsEnabled = false;
                }
            }));

            pb.Dispatcher.BeginInvoke(new Action(() => {
                if (!e.IsProcessKnow && pb.IsIndeterminate == false)
                {
                    pb.IsIndeterminate = true;;
                }
                else
                {
                    pb.Value   = e.Current;
                    pb.Maximum = e.Max;
                }
            }));
        }