Пример #1
0
        public void getResults(List <IInputData> inputDataList, List <ICatItem> resultsList)
        {
            if (!inputDataList[0].hasLabel(m_labelHash))
            {
                return;
            }

            string windowNameToMatch = inputDataList[1].getText();

            if (windowNameToMatch == "")
            {
                return;
            }

            m_windowNameMatcher.windowNameToMatch = windowNameToMatch;

            m_topLevelWindows = m_windowController.topLevelWindows();

            foreach (string windowName in m_topLevelWindows.Keys)
            {
                if (m_windowNameMatcher.hasMatch(windowName))
                {
                    ICatItem result = m_catItemFactory.createCatItem(
                        windowName + ".go-y", windowName, getID(), getIcon());
                    resultsList.Add(result);
                }
            }
        }
Пример #2
0
        public void launchItem(List <IInputData> inputDataList, ICatItem item)
        {
            ICatItem catItem =
                inputDataList[inputDataList.Count - 1].getTopResult();

            MessageBox.Show("I was asked to launch: " + item.getFullPath());
        }
Пример #3
0
        public void launchItem(List <IInputData> inputDataList, ICatItem item)
        {
            ICatItem catItem =
                inputDataList[inputDataList.Count - 1].getTopResult();

            try
            {
                IntPtr hWnd = m_topLevelWindows[catItem.getShortName()];
                m_windowController.goToWindow(hWnd);
            }
            catch (Exception)
            {
            }
        }
Пример #4
0
 public void launchItem(List<IInputData> inputDataList, ICatItem item)
 {
     ICatItem catItem =
         inputDataList[inputDataList.Count - 1].getTopResult();
     try
     {
         IntPtr hWnd = m_topLevelWindows[catItem.getShortName()];
         m_windowController.goToWindow(hWnd);
     }
     catch (Exception )
     {
     }
 }
Пример #5
0
 public void launchItem(List<IInputData> inputDataList, ICatItem item)
 {
     ICatItem catItem =
         inputDataList[inputDataList.Count-1].getTopResult();
     MessageBox.Show("I was asked to launch: " + item.getFullPath());
 }
Пример #6
0
        private void showLaunchItemStuff(List <IInputData> inputDataList, ICatItem item)
        {
            var sb = new StringBuilder();
            var nl = Environment.NewLine;

            sb.Append("Input data:");
            sb.Append(nl);
            foreach (var i in inputDataList)
            {
                var top = i.getTopResult();
                sb.Append("ID: ");
                sb.Append(i.getID());
                sb.Append(nl);
                sb.Append("Text: ");
                sb.Append(i.getText());
                sb.Append(nl);
                sb.Append("Has spaghetty label: ");
                sb.Append(i.hasLabel(getID()));
                sb.Append(nl);
                sb.Append("Top result");
                sb.Append(nl);
                sb.Append("Full path: ");
                sb.Append(top.getFullPath());
                sb.Append(nl);
                sb.Append("Icon path: ");
                sb.Append(top.getIconPath());
                sb.Append(nl);
                sb.Append("ID: ");
                sb.Append(top.getID());
                sb.Append(nl);
                sb.Append("Low name: ");
                sb.Append(top.getLowName());
                sb.Append(nl);
                sb.Append("Short name: ");
                sb.Append(top.getShortName());
                sb.Append(nl);
                sb.Append("Usage: ");
                sb.Append(top.getUsage());
                sb.Append(nl);

                sb.Append("-----");

                sb.Append(nl);
            }

            sb.Append("Full path: ");
            sb.Append(item.getFullPath());
            sb.Append(nl);
            sb.Append("Icon path: ");
            sb.Append(item.getIconPath());
            sb.Append(nl);
            sb.Append("ID: ");
            sb.Append(item.getID());
            sb.Append(nl);
            sb.Append("Low name: ");
            sb.Append(item.getLowName());
            sb.Append(nl);
            sb.Append("Short name: ");
            sb.Append(item.getShortName());
            sb.Append(nl);
            sb.Append("Usage: ");
            sb.Append(item.getUsage());
            sb.Append(nl);
            sb.Append("tostring: ");
            sb.Append(item.ToString());

            MessageBox.Show(sb.ToString());
        }
Пример #7
0
        public void launchItem(List <IInputData> inputDataList, ICatItem item)
        {
            //so
            // item is worthless, it's just the main Spaghetty
            // inputDataList, and specifically .getTopResult of each input item, is what i want
            // so possibilities:
            // one input (just spaghetty): ? maybe nothing
            // two inputs: show the selected one; maybe open it for editing
            // three inputs: create/replace? maybe



            //TODO clean up this whole mess

            if (inputDataList.Count < 2)
            {
                var lp = _pluginHost.launchyPaths();
                var sb = new StringBuilder();
                var nl = Environment.NewLine;

                sb.Append(lp.getConfigPath());
                sb.Append(nl);
                sb.Append(lp.getIconsPath());
                sb.Append(nl);
                sb.Append(lp.getLaunchyPath());

                MessageBox.Show(sb.ToString());
                return;
            }

            var selectedPasta = inputDataList[1].getTopResult();
            var fp            = selectedPasta.getFullPath();

            string  key      = "nothing";
            string  text     = "if you can read this, something went wrong";
            Boolean newPasta = false;

            if (fp.EndsWith(SPG_EXT))
            {
                key = fp.Substring(0, fp.Length - SPG_EXT.Length);
                _spagBowl.TryGetValue(key, out text);
            }
            else if (fp.EndsWith(NEW_EXT))
            {
                key      = fp.Substring(0, fp.Length - NEW_EXT.Length);
                newPasta = true;
                if (inputDataList.Count > 2)
                {
                    text = inputDataList[2].getText();
                }
                else
                {
                    text = "";
                }
            }

            var pw = new DisplayPasta(key, text);

            if (newPasta)
            {
                pw.SetOriginalPasta("");
            }

            var result = pw.ShowDialog();

            if (result == DialogResult.OK)
            {
                //TODO add renaming
                _spagBowl[key] = pw.GetPasta();

                _spagBowl.Save();
            }
        }
Пример #8
0
        public void launchItem(List<IInputData> inputDataList, ICatItem item)
        {
            ICatItem catItem = inputDataList[inputDataList.Count - 1].getTopResult();

            char[] seperator = { ':' };
            string[] namePair = catItem.getFullPath().Split(seperator, 2);

            Launcher.getInstance().Launch(namePair[0], namePair[1]);
        }
Пример #9
0
 public void launchItem(List<IInputData> inputDataList, ICatItem item)
 {
     var uri = item.getFullPath();
     Process.Start(uri);
 }