public void ExecuteLater(VoidNoParamDelegate d) { if (_invokationTarget.InvokeRequired) { _invokationTarget.Invoke(new Action <VoidNoParamDelegate>(ExecuteLater), new Object[] { d }); } else { if (disposedValue) { // Silent throw new InvalidOperationException("ExecuteLater Disposed"); } _executeLaterQueue.Enqueue(d); _executeLaterTimer.Start(); Application.DoEvents(); } }
private void ConsumeQueue() { if (_executeLaterQueue.Count > 0) { VoidNoParamDelegate tt = _executeLaterQueue.Dequeue(); try { tt(); }catch (Exception e) { core.manager.SLogManager.getInstance().getClassLogger(typeof(CmdQueue)).Error(e.Message); } } if (_executeLaterQueue.Count > 0) { _executeLaterTimer.Start(); } }