private void Run() { while (!_retinaProcessStopped) { if (_queue.Count > 0) { try { RetinaTaskResponse currentResponse = _queue.Dequeue(); if (!string.IsNullOrWhiteSpace(currentResponse?.Message)) { _syncContext.Post(e => TriggerLogCallback(currentResponse), null); } else if (currentResponse?.Node != null) { _syncContext.Post(e => TriggerTreeCallback(currentResponse), null); } } catch { // suppress } } //Thread.Sleep(500); } }
private void TriggerTreeCallback(RetinaTaskResponse response) => CallbackTree?.Invoke(this, response);
private void TriggerLogCallback(RetinaTaskResponse response) => CallbackLog?.Invoke(this, response);