/// <summary> /// Updates all messages in the list view to show only those meeting the /// selection criteria. /// </summary> private void RefreshMessages() { //Check if we have a task if (Task == null) { return; } //Check if we have any session selected if (filterSessionCombobox.SelectedIndex == -1) { return; } Application.UseWaitCursor = true; LogSinkBase sink = Task.Log[filterSessionCombobox.SelectedIndex]; EntryCache.Clear(); SelectedEntries.Clear(); EntryCache.AddRange(sink.Where(MeetsCriteria)); //Set the list view size and update all the control states log.VirtualListSize = EntryCache.Count; log.Refresh(); EnableButtons(); Application.UseWaitCursor = false; }
private void clear_Click(object sender, EventArgs e) { //Clear the backing store Task.Log.Clear(); //Reset the list of sessions filterSessionCombobox.Items.Clear(); //And reset the list-view control log.VirtualListSize = 0; SelectedEntries.Clear(); EntryCache.Clear(); //Finally update the UI state. EnableButtons(); }