internal void TrucateElements() { if (AllElements.Count > 0) { this.Description += " Removed: " + this.AllElements[0].Name; AllElements.Clear(); } }
private void Filter() { AllElements.Clear(); DBRepository <Elements> dBRepository = new DBRepository <Elements>(new BuildEntities()); foreach (var item in dBRepository.GetAll().Where(s => s.Type.ToUpper().Contains(Find.ToUpper()) || s.Title.ToUpper().Contains(Find.ToUpper()))) { AllElements.Add(item); } dBRepository.Dispose(); }
public virtual void InitElements() { RootElements.Clear(); AllElements.Clear(); foreach (var cell in Current.ForEach()) { Init(cell); } if (MouseMoveElement != null) { AddAndInitElement(MouseMoveElement); } if (Text != null) { AddAndInitElement(Text); } }
private async void UpdateExecute() { try { projectWatcher?.Watcher?.Dispose(); if (inUpdate || !Directory.Exists(ShortcutFolder)) { return; } // projectWatcher = new FileWatcherRx(ShortcutFolder, "", (NotifyFilters) 19, WatcherChangeTypes.All); // projectWatcher.Watcher.IncludeSubdirectories = true; // projectWatcher.Created.ObserveOn(dispatcher).Subscribe(s => OnCreatedProject(s.EventArgs)); // projectWatcher.Deleted.ObserveOn(dispatcher).Subscribe(s => OnDeletedProject(s.EventArgs)); // projectWatcher.Renamed.ObserveOn(dispatcher).Subscribe(s => OnRenamedProject(s.EventArgs)); // projectWatcher.Changed.ObserveOn(dispatcher).Subscribe(s => OnChangedProject(s.EventArgs)); inUpdate = true; var files = new List <FileInfo>(); AllElements.Clear(); AllProjects.Clear(); await ShowProgressDialog(c => { c.SetIndeterminate(); if (ShortcutFolder == null || !Directory.Exists(ShortcutFolder)) { return; } files = GetShortcutFiles(ShortcutFolder).Result; }, "Загрузка элементов...", "", false); if (!files.Any()) { ShowMessage("Не найдены файлы быстрых ссылок (xml)"); return; } foreach (var xmls in files.ChunkBy(50)) { var items = await GetShortcutItems(xmls); foreach (var i in items) { Checks.CheckElement(i); i.Project.Shortcuts.Add(i); AllElements.Add(i); } } var projects = Project.GetProjects(); AllProjects.AddRange(projects); ProjectsVM.UpdateProjects(); } catch (Exception ex) { ShowMessage(ex.ToString()); } finally { inUpdate = false; } }