private void разъединитьToolStripMenuItem_Click(object sender, EventArgs e) { for (int i = 0; i < treeView1.SelectedNode.Nodes.Count; i++) { AxMSTSCLib.AxMsRdpClientNotSafeForScripting rc = (AxMSTSCLib.AxMsRdpClientNotSafeForScripting)treeView1.SelectedNode.Nodes[i].Tag; if (rc.Connected == 1) { rc.Disconnect(); } } }
private void соединитьсяToolStripMenuItem1_Click(object sender, EventArgs e) { AxMSTSCLib.AxMsRdpClientNotSafeForScripting rc = treeView1.SelectedNode.Tag as AxMSTSCLib.AxMsRdpClientNotSafeForScripting; if (rc.Connected != 1) { ConnectNode(treeView1.SelectedNode); } else { rc.Disconnect(); } }