예제 #1
0
        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);
                });
            }
        }
예제 #2
0
        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);
        }
예제 #3
0
        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;
                });
            });
        }
예제 #4
0
 public void SetAllCataloguesMode()
 {
     DatabaseObjects.Clear();
 }
예제 #5
0
 public void ClearDatabaseObjects()
 {
     DatabaseObjects.Clear();
 }