private void ExecuteSelectedListViewItem(bool asAdmin = false, bool openContainingFolder = false) { try { var index = 0; if (SelectedIndex != -1) { index = SelectedIndex; } else { } Messenger.Default.Send <bool>(true, MessengerID.HideWindow); if (SearchSuggestions.Count > 0) { RunItemFactory.Start(SearchSuggestions[index], asAdmin, openContainingFolder); if (!openContainingFolder ) //We didn't actually start the application. Just the folder. Ignore the counter { Indexing.AddExecutedItem(SearchSuggestions[index]); Indexing.SaveTries(); } forceNewSearch = true; } } catch (Exception e) { Log.Error(e, "Could not execute application"); } }
private void AddGoodStuffToPrioMatcher() { Task.Run(() => { if (S.Settings.IncludeWindowsSettings) { foreach (var setting in RunItemFactory.Settings) { AddItem(setting); } AddItem(RunItemFactory.RunDialog()); AddItem(RunItemFactory.TurnOffComputer()); AddItem(RunItemFactory.HibernateWindows()); AddItem(RunItemFactory.LockWindows()); AddItem(RunItemFactory.LogOffWindows()); AddItem(RunItemFactory.RestartComputer()); AddItem(RunItemFactory.SleepWindows()); AddItem(RunItemFactory.SleepWindows()); } }); }