Exemple #1
0
        public static ConnectToDialog NewConnectToDialog(Form parentForm)
        {
            ConnectToDialog connectToDialog = new ConnectToDialog("连接到", "连接", parentForm);

            connectToDialog.Server = TemporaryServer.CreateForQuickConnect();
            connectToDialog.CreateControls(inputServerName: true, connectToDialog.Server.LogonCredentials, connectToDialog.Server.ConnectionSettings, null);
            return(connectToDialog);
        }
Exemple #2
0
 public static void ConnectTo()
 {
     using (ConnectToDialog connectToDialog = ConnectToDialog.NewConnectToDialog(Program.TheForm))
     {
         if (connectToDialog.ShowDialog() == DialogResult.OK)
         {
             Server server = TemporaryServer.Create(connectToDialog);
             server.Connect();
             ServerTree.Instance.SelectedNode = server;
         }
     }
 }
Exemple #3
0
        public static TemporaryServer Create(ConnectToDialog dlg)
        {
            TemporaryServer server = dlg.Server;

            dlg.UpdateSettings();
            server.Properties.ServerName.Value  = dlg.QuickConnectTabPage.ServerNameTextBox.Text;
            server.Properties.DisplayName.Value = dlg.QuickConnectTabPage.ServerNameTextBox.Text;
            server.LogonCredentials.InheritSettingsType.Mode   = InheritanceMode.None;
            server.ConnectionSettings.InheritSettingsType.Mode = InheritanceMode.None;
            server.FinishConstruction(ConnectToGroup.Instance);
            ConnectToGroup.Instance.IsInTree = true;
            return(server);
        }