/// <summary> /// /// </summary> /// <param name="data"></param> private void OnQuerier_SensorQueryComplete(List <Sensor> data) { MethodInvoker methodInvoker = delegate { try { if (data == null) { UserInterface.DisplayErrorMessageBox(this, "No data retrieved for query"); return; } listSensors.SetObjects(data); } catch (Exception ex) { UserInterface.DisplayMessageBox(this, "An error occurred whilst retrieving the sensor data: " + ex.Message, MessageBoxIcon.Exclamation); } finally { ResizeListColumns(); SetProcessingStatus(true); _hourGlass.Dispose(); } }; if (this.InvokeRequired == true) { this.BeginInvoke(methodInvoker); } else { methodInvoker.Invoke(); } }
/// <summary> /// /// </summary> /// <param name="data"></param> private void OnQuerier_EventQueryComplete(List <Event> data) { MethodInvoker methodInvoker = delegate { try { if (data == null) { UserInterface.DisplayMessageBox(this, "No data retrieved for query", MessageBoxIcon.Exclamation); return; } if (data.Count > _pageLimit) { data = data.Slice(0, _pageLimit).ToList(); _moreData = true; } else { _moreData = false; } listEvents.SetObjects(data); if (data.Any() == true) { listEvents.SelectedObject = data[0]; listEvents_SelectedIndexChanged(this, null); } lblPagingEvents.Text = "Page " + _currentPage; OnMessage("Loaded " + data.Count + " results"); } catch (Exception ex) { UserInterface.DisplayErrorMessageBox(this, "An error occurred whilst performing the search: " + ex.Message); } finally { Helper.ResizeEventListColumns(listEvents, true); SetPagingControlState(); SetProcessingStatus(true); _hourGlass.Dispose(); listEvents.Select(); } }; if (this.InvokeRequired == true) { this.BeginInvoke(methodInvoker); } else { methodInvoker.Invoke(); } }
/// <summary> /// /// </summary> /// <param name="entries"></param> private void OnImporter_Complete(List <AutoRunEntry> entries) { MethodInvoker methodInvoker = delegate { foreach (ColumnHeader colHeader in listEntries.Columns) { if (colHeader.Name == "olvcMd5" || colHeader.Name == "olvcSha256") { continue; } colHeader.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); } SetProcessingState(true); _hourGlass.Dispose(); }; if (this.InvokeRequired == true) { this.BeginInvoke(methodInvoker); } else { methodInvoker.Invoke(); } }
/// <summary> /// /// </summary> /// <param name="message"></param> private void OnExporter_Exclamation(string message) { _hourGlass.Dispose(); UserInterface.DisplayMessageBox(this, message, MessageBoxIcon.Exclamation); SetProcessingStatus(true); }