Пример #1
0
        private void openSessionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            QuickSelector q = new QuickSelector();
            QuickSelectorData data = new QuickSelectorData();
            data.CaseSensitive = SuperPuTTY.Settings.QuickSelectorCaseSensitiveSearch;

            // TODO
            foreach (SessionData sd in SuperPuTTY.GetRootFolderData().GetSessionsList(SuperPuTTY.GetRootFolderData()))
            {
                data.ItemData.AddItemDataRow(
                    sd.SessionName,
                    sd.SessionName,
                    sd.Proto == ConnectionProtocol.Cygterm || sd.Proto == ConnectionProtocol.Mintty ? Color.Blue : Color.Black,
                    null);
            }

            QuickSelectorOptions opt = new QuickSelectorOptions();
            opt.Sort = data.ItemData.DetailColumn.ColumnName;
            opt.BaseText = "Open Session";

            QuickSelector d = new QuickSelector();
            if (d.ShowDialog(this, data, opt) == DialogResult.OK)
            {
                SuperPuTTY.OpenPuttySession(d.SelectedItem.Detail);
            }
        }
Пример #2
0
        private void switchSessionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            QuickSelector q = new QuickSelector();
            QuickSelectorData data = new QuickSelectorData();
            data.CaseSensitive = SuperPuTTY.Settings.QuickSelectorCaseSensitiveSearch;

            foreach (ToolWindow content in this.tabSwitcher.Documents)
            {
                ctlPuttyPanel panel = content as ctlPuttyPanel;
                if (content != null)
                {
                    SessionData sd = panel.Session;
                    data.ItemData.AddItemDataRow(
                        panel.Text,
                        sd.SessionName,
                        sd.Proto == ConnectionProtocol.Cygterm || sd.Proto == ConnectionProtocol.Mintty ? Color.Blue : Color.Black,
                        panel);
                }
            }

            QuickSelectorOptions opt = new QuickSelectorOptions();
            opt.Sort = data.ItemData.DetailColumn.ColumnName;
            opt.BaseText = "Switch Session";
            opt.ShowNameColumn = true;

            QuickSelector d = new QuickSelector();
            if (d.ShowDialog(this, data, opt) == DialogResult.OK)
            {
                ctlPuttyPanel panel = (ctlPuttyPanel) d.SelectedItem.Tag;
                panel.Activate();
            }
        }