private void ExecuteFilter() { lock (gawd) { IEnumerable <DBObjectViewModel> filteredList; if (string.IsNullOrWhiteSpace(ResultsFilter)) { // if there's no filter, just use the plain ol' list filteredList = actualList; } else { var pred = DBObjectSearch.BuildPredicateFromSearchText(ResultsFilter); filteredList = from item in actualList where pred.Invoke(item) select item; } foreach (var found in filteredList) { DatabaseObjects.Add(found); } Execute.OnUIThread(() => { DatabaseObjects.Clear(); DatabaseObjects.AddRange(filteredList); }); } }
public void SetSingleCatalogueMode(Catalogue catalogue) { if (catalogue == null) { throw new ArgumentException("Catalogue must not be null to turn on SingleCatalogue mode", "catalogue"); } DatabaseObjects.Clear(); DatabaseObjects.Add(catalogue); }
private void ExecuteRefreshCommand() { this.refreshIsRunning = true; LoadingDatabaseObjects = true; DatabaseObjects.Clear(); DatabaseObjects.Add(new SimpleNodeViewModel("Retrieving information...")); Task.Factory.StartNew <ObservableCollection <NodeViewModel> >(GetDatabaseObjectsAsync) .ContinueWith((previousTask) => { Application.Current.Dispatcher.Invoke(() => { DatabaseObjects.Clear(); foreach (NodeViewModel dbObject in previousTask.Result) { DatabaseObjects.Add(dbObject); } this.refreshIsRunning = false; LoadingDatabaseObjects = false; }); }); }
public void SetAllCataloguesMode() { DatabaseObjects.Clear(); }
public void ClearDatabaseObjects() { DatabaseObjects.Clear(); }