public void Execute(string shortcutKey, ILaunchShortcut launchShortcut = null)
        {
            if (string.IsNullOrWhiteSpace(shortcutKey))
            {
                return;
            }

            //Just google it
            if (!shortcutCollection.Shortcuts.ContainsKey(shortcutKey))
            {
                ProcessStart("https://www.google.com/search?q=" + shortcutKey.Replace(' ', '+'));
                return;
            }

            launchShortcut = launchShortcut ?? shortcutCollection.QueryResults[shortcutKey];
            launchShortcut.Execute(new Dictionary <string, string>(), GetFormattedString(Arguments, launchShortcut.Description));
            Arguments.Clear();
        }
        public void Execute(string shortcutKey, ILaunchShortcut launchShortcut = null)
        {
            if (string.IsNullOrWhiteSpace(shortcutKey))
            {
                return;
            }

            //Just google it
            if (!shortcutCollection.Shortcuts.ContainsKey(shortcutKey))
            {
                ProcessStart("https://www.google.com/search?q=" + HttpUtility.UrlEncode(shortcutKey));
                return;
            }

            launchShortcut = launchShortcut ?? shortcutCollection.QueryResults.First(x => x.Key == shortcutKey).Value;
            launchShortcut.Execute(new Dictionary <string, string>(), GetFormattedString(Arguments, launchShortcut.Description));
            Arguments.Clear();
        }
Esempio n. 3
0
 public void OnShortcutLaunched(ILaunchShortcut shortcut)
 {
 }