示例#1
0
        public void RunAsync(FileInfo oprfile, RunProgress progress, RunCompleted completed)
        {
            if (_status == RunStatus.running)
            {
                throw new Exception("Already running, cannot start additional run");
            }

            _oprfile = oprfile;

            worker = new BackgroundWorker();

            worker.DoWork += new DoWorkEventHandler(DoRun);

            _reportProgress = progress != null;

            this.progress  = progress;
            this.completed = completed;

            worker.WorkerReportsProgress      = _reportProgress;
            worker.WorkerSupportsCancellation = _allowCancel;

            worker.RunWorkerCompleted += worker_RunWorkerCompleted;
            worker.ProgressChanged    += worker_ProgressChanged;

            worker.RunWorkerAsync();

            _status = RunStatus.running;
        }
示例#2
0
 void IProgress <JenkinsRunProgress> .Report(JenkinsRunProgress value)
 {
     RunProgress?.Invoke(this, value);
 }