NetIde.Services.JobManager.NiJob.RaisePerform C# (CSharp) Method

RaisePerform() public method

public RaisePerform ( ) : void
return void
        public void RaisePerform()
        {
            Running = true;

            try
            {
                ErrorUtil.ThrowOnFailure(Handler.Perform(this));

                Success = true;
            }
            catch (Exception ex)
            {
                _syncContext.Send(
                    p => _jobManager.CreateTaskDialog()
                        .FromException(ex)
                        .Show(),
                    null
                );

                Exception = ex;
            }
            finally
            {
                Running = false;
                Completed = true;
            }
        }

Usage Example

Beispiel #1
0
        private void ProcessJobs(object state)
        {
            lock (_syncRoot)
            {
                if (_queue.Count == 0)
                {
                    return;
                }

                _currentJob = _queue.Peek();
            }

            while (true)
            {
                _currentJob.RaisePerform();

                _event.Set();

                lock (_syncRoot)
                {
                    var removedJob = _queue.Dequeue();

                    OnJobRemoved(new JobEventArgs(removedJob));

                    if (_queue.Count == 0)
                    {
                        OnProgressChanged(new JobEventArgs(null));

                        break;
                    }

                    _currentJob = _queue.Peek();
                }
            }

            lock (_syncRoot)
            {
                _currentJob = null;
            }
        }
All Usage Examples Of NetIde.Services.JobManager.NiJob::RaisePerform