Пример #1
0
        private void EstablishNewConnection()
        {
            frmConnectionSelection selector = new frmConnectionSelection();

            selector.SetConnectionGroupInfos(this._model.GetAvailableConnections());

            if (selector.ShowDialog() == DialogResult.OK)
            {
                ConnectionGroupInfo connectionGroup = selector.SelectedConnectionGroupInfo.ExtractSelectedGroup();

                ConnectionTabControl targetTab = GetTargetTab(connectionGroup.Name + "{" + connectionGroup.TemplateFileName + "}");

                targetTab.OpenConnection(connectionGroup);
            }
        }
Пример #2
0
        private void mnuNewDirectConnection_Click(object sender, EventArgs e)
        {
            using (CreateDirectConnectionDialog createConnectionDialog = new CreateDirectConnectionDialog(this._model))
            {
                if (createConnectionDialog.ShowDialog() == DialogResult.OK)
                {
                    ConnectionData      connectionData = createConnectionDialog.ResultConnection;
                    ConnectionGroupInfo group          = connectionData.ConnectionGroup;

                    Template selectedTemplate = TemplateNodesLoader.GetTemplateByFile(
                        createConnectionDialog.SelectedTemplateFileFullPath
                        );

                    ConnectionTabControl targetTab = GetTargetTab(
                        group.Name + " {" + group.TemplateFileName + "}"
                        );

                    targetTab.SelectedTemplate = selectedTemplate;

                    targetTab.OpenConnection(group);
                }
            }
        }