private void OnFlush() { try { this.GuiSync(() => DataLoading.SafeInvoke()); while (true) { Query query; lock (_syncObject) { _isChanged = false; if (_query == null) { this.GuiAsync(() => DataLoaded.SafeInvoke()); _isFlushing = false; break; } query = _query; _query = null; } Process(query.Item1, query.Item2, query.Item3, query.Item4); } } catch (Exception ex) { this.GuiAsync(() => { DataLoaded.SafeInvoke(); throw new InvalidOperationException(LocalizedStrings.Str1538, ex); }); } }