internal void UpdateConn( ConnectionNode conn )
 {
     this.Connection = conn;
     this.txtConnectionString.Text = conn.ConncetionString;
     this.txtName.Text = conn.Name;
     this.cmbDbType.SelectedValue = conn.DbType.ToString();
 }
 private void btnOK_Click(object sender, EventArgs e)
 {
     if (this.Connection == null)
     {
         this.Connection = new ConnectionNode();
     }
     this.Connection.Name = this.txtName.Text.Trim();
     this.Connection.ConncetionString = this.txtConnectionString.Text.Trim();
     this.Connection.DbType = ((KeyValuePair<DatabaseType, string>)this.cmbDbType.SelectedItem).Key;
     this.DialogResult = System.Windows.Forms.DialogResult.OK;
     this.Close();
 }
        public void Reset(System.Collections.IEnumerable connectionTypes)
        {
            this.Children.Clear();

            foreach (ConnectionType connType in connectionTypes)
            {
                ConnectionNode connNode = new ConnectionNode();
                connNode.DataInfo = connType;
                connNode.Parent   = this;

                GlobalService.ModelManager.RegistDb(connType);
            }
        }
        public void Reset(System.Collections.IEnumerable connectionTypes)
        {
            this.Children.Clear();

            foreach (ConnectionType connType in connectionTypes)
            {
                ConnectionNode connNode = new ConnectionNode();
                connNode.DataInfo = connType;
                connNode.Parent = this;

                GlobalService.ModelManager.RegistDb(connType);

            }
        }
        void NewConnection_Click(object sender, EventArgs args)
        {
            ConnectionNode child = new ConnectionNode();

            child.Text=child.Name = Guid.NewGuid().ToString();
            child.DataInfo =  DBGlobalService.CurrentProject.CreateConnectionType();
            ConnectionEditFrm frm = new ConnectionEditFrm();
            frm.UpdateConn(child);
            if (frm.ShowDialog() == DialogResult.OK)
            {
                child.Text = child.Name;
                child.Parent = this;
                this.OnRefresh(sender, args);
            }
        }
        void NewConnection_Click(object sender, EventArgs args)
        {
            ConnectionNode child = new ConnectionNode();

            child.Text     = child.Name = Guid.NewGuid().ToString();
            child.DataInfo = DBGlobalService.CurrentProject.CreateConnectionType();
            ConnectionEditFrm frm = new ConnectionEditFrm();

            frm.UpdateConn(child);
            if (frm.ShowDialog() == DialogResult.OK)
            {
                child.Text   = child.Name;
                child.Parent = this;
                this.OnRefresh(sender, args);
            }
        }