public void GetDesktop() { Properties = null; Patterns = null; Image = null; Elements = new ObservableCollection <ElementBO>(); var item = _automation.GetDesktop(); SearchResults = new ISHAutomationElement[0]; CurrentSearchIndex = 0; _treeWalker = _automation.TreeWalkerFactory.GetControlViewWalker(); DesktopItem = item != null ? item : null; var items = DesktopItem.FindAllByXPath("*").Select(x => new ElementBO(new SHAutomationElement(x.FrameworkAutomationElement))); foreach (var win in items) { if (SavedSettingsWindows.Any(x => (!string.IsNullOrEmpty(win.AutomationId?.Trim()) && win.AutomationId.StartsWith(x.Identifier)) || (!string.IsNullOrEmpty(win.Name?.Trim()) && win.Name.StartsWith(x.Identifier)))) { if (!Elements.Any(x => x.AutomationElement.Equals(win.AutomationElement))) { Elements.Add(win); Elements.ToList().ForEach(x => x.IsExpanded = true); } } } if (Elements.Any()) { SelectedItem = Elements.First(); } _dispatcherTimer = new DispatcherTimer(); _dispatcherTimer.Tick += DispatcherTimerTick; _dispatcherTimer.Interval = TimeSpan.FromMilliseconds(1); _dispatcherTimer.Start(); }
public void UpdateSettingsWindowList() { IdentifierToAdd = null; if (DesktopItem != null && IsSettings) { SettingsWindowList = DesktopItem.FindAllByXPath("*").Where(x => !string.IsNullOrEmpty(x.Name?.Trim()) || !string.IsNullOrEmpty(x.AutomationId?.Trim())).Select(x => new WindowBO(x, true)).ToList(); } else { SettingsWindowList = new List <WindowBO>(); GetDesktop(); UpdateSettings(); } }
public JSONMapperGroupItemWidget(DesktopItem item) : base(item) { scale = item.transform.localScale; }
public JSONMapperLinkItem(DesktopItem item) : base(item) { urlPath = ((LinkItem)item).urlPath; iconPath = ((LinkItem)item).IconPath; }
public JSONMapperVideoItem(DesktopItem item) : base(item) { pathVideo = ((VideoItem)item).pathVideo; isSticked = ((VideoItem)item).isSticked; scale = item.transform.localScale; }
public JSONMapperNoteWidgetItem(DesktopItem item) : base(item) { // Remember, in notes: text == nameFile. isPinEnabled = ((NoteItemWidget)item).IsPinEnabled; }