public void Start()
 {
     if (!started)
     {
         backgroundWorker.Start(backgroundWorkerKey, Clear, expiration, expiration);
         started = true;
     }
 }
예제 #2
0
 public void Add(IBackgroundWorker worker)
 {
     _backgroundWorkers.Append(worker);
     if (IsRunning)
     {
         worker.Start();
     }
 }
        public void Add(IBackgroundWorker worker)
        {
            _backgroundJobs.Add(worker);

            if (IsRunning)
            {
                worker.Start();
            }
        }
        public void Add(IBackgroundWorker worker)
        {
            this._backgroundJobs.Add(worker);

            if (this.IsRunning)
            {
                worker.Start();
            }
        }
        public void Execute()
        {
            if (_interval == 0)
            {
                _interval = 10000;
            }

            if (!_backgroundWorkerActive)
            {
                FunctionImplementation();
            }
            else
            {
                _worker          = new TimerBackgroundWorker(_interval);
                _worker.Function = () => FunctionImplementation();
                _worker.Start();
            }
        }
예제 #6
0
        public void Execute()
        {
            _currentname = "No Name Set";

            if (_isBackgroundWorkerActive == false)//If no worker -> just do the implementation now!
            {
                FunctionImplementation();
            }
            else//if we are using an worker -> start the worker
            {
                _worker = new TimerBackgroundWorker(_interval);
                if (_interval == 0)
                {
                    _worker = new TimerBackgroundWorker();
                }
                _worker.Function = () => FunctionImplementation();
                _worker.Start();
            }
        }