Example #1
0
        public void LoadRemoteConnection(Machine parEntMachine, bool isConsole)
        {
            RemoteDesktopControllerTabPage insRdpTp = new RemoteDesktopControllerTabPage();

            insRdpTp.Text = parEntMachine.RemoteDesktopConnectionName;
            foreach (TabPage tp in tcMain.TabPages)
            {
                if (tp.Text == insRdpTp.Text)
                {
                    tcMain.SelectTab(tp);
                    return;
                }
            }

            tcMain.TabPages.Add(insRdpTp);
            if (isConsole)
            {
                insRdpTp.ConnectViaConsole(parEntMachine);
            }
            else
            {
                insRdpTp.Connect(parEntMachine);
            }
            tcMain.SelectTab(insRdpTp);

            ToolStripMenuItem tsmiDisconnect = new ToolStripMenuItem(parEntMachine.RemoteDesktopConnectionName);

            tsmiDisconnect.Tag = parEntMachine.MachineName;
            disconnectFromToolStripMenuItem.DropDownItems.Add(tsmiDisconnect);
            tsmiDisconnect.Click += new EventHandler(tsmiDisconnect_Click);
        }
Example #2
0
        private void connectAllToolStripMenuItem_Click(object sender, EventArgs e)
        {
            tcMain.TabPages.Clear();

            foreach (Machine m in GetRemoteDesktops())
            {
                RemoteDesktopControllerTabPage insRdpTp = new RemoteDesktopControllerTabPage();
                tcMain.TabPages.Add(insRdpTp);
                insRdpTp.Text = m.RemoteDesktopConnectionName;
                insRdpTp.Connect(m);
            }
        }