예제 #1
0
 private void btnChooseOtherServer_Click(object sender, EventArgs e)
 {
     var db = TreeSelectForm.SelectDatabase();
     if (db != null)
     {
         Async.SafeClose(m_conn.Connection);
         SetDatabase(db.CloneSource());
     }
 }
예제 #2
0
        public static IPhysicalConnection SelectQueryableConnection()
        {
            TreeSelectForm win = new TreeSelectForm();

            win.daTreeView1.TreeBehaviour.ShowFilter = node => node.IsQueryableNodeOrParent();
            win.daTreeView1.RootPath = "data:";
            if (win.ShowDialogEx() == DialogResult.OK)
            {
                return(win.daTreeView1.Selected.GetConnection());
            }
            return(null);
        }
예제 #3
0
        public static IDatabaseSource SelectDatabase()
        {
            TreeSelectForm win = new TreeSelectForm();

            win.daTreeView1.TreeBehaviour.ShowFilter = node => node.IsDatabaseNodeOrParent();
            win.daTreeView1.TreeBehaviour.AllowDoubleClickNodeHandling = false;
            win.daTreeView1.RootPath = "data:";
            win.SelectedOk          += new EventHandler <CheckSelectedOkEventArgs>(win_SelectedOk);
            if (win.ShowDialogEx() == DialogResult.OK)
            {
                var node = win.daTreeView1.Selected as IDatabaseTreeNode;
                if (node != null)
                {
                    return(node.DatabaseConnection);
                }
            }
            return(null);
        }