private void InvalidateRowFilter() { if (_applyRowFilterTask != null) { _applyRowFilterTask.Dispose(); _applyRowFilterTask = null; } var bindingListView = GetBindingListView(); if (bindingListView == null) { return; } if (_filterText != tbxFind.Text) { var unfilteredRows = bindingListView.UnfilteredItems.ToArray(); if (string.IsNullOrEmpty(tbxFind.Text)) { bindingListView.SetFilteredItems(unfilteredRows); _filterText = ""; } else { _applyRowFilterTask = new ApplyRowFilterTask(unfilteredRows, bindingListView.GetItemProperties(new PropertyDescriptor[0]).Cast <PropertyDescriptor>().ToArray(), tbxFind.Text); new Action(_applyRowFilterTask.FilterBackground).BeginInvoke(ApplyRowFilterTaskCallback, _applyRowFilterTask); } } }
private void SetFilteredRowsNow(ApplyRowFilterTask applyRowFilterTask, IList <RowItem> rows) { try { } finally { applyRowFilterTask.Dispose(); } }