private void NewConnectDb(DbConnectConfigure configure = null, ConnectInfo info = null, TreeNode node = null) { FrmOpenDb openDb = new FrmOpenDb(); DialogResult dr = openDb.ShowDialog(this); if (dr == DialogResult.Cancel) { return; } else { if (node == null) { node = new TreeNode(); tvConnectList.Nodes[0].Nodes.Add(node); } if (info == null) { info = new ConnectInfo(node); } node.Tag = info; info.DbConnectConfigure = openDb.DbConnectConfigure; if (dr == DialogResult.OK) { FrmDatabase frmdb = new FrmDatabase(openDb.DbClass); frmdb.DbConnectConfigure = info.DbConnectConfigure; info.FrmDataBase = frmdb; ShowOrActiveForm(frmdb); } info.Node = node; tvConnectList.ExpandAll(); SaveConnectInfos(); } }
private void DoOpen(ConnectInfo info) { if (info != null) { if (info.FrmDataBase != null) { ShowOrActiveForm(info.FrmDataBase); } else if (info.DbConnectConfigure != null) { FrmDatabase frmdb = new FrmDatabase(null); info.FrmDataBase = frmdb; ShowOrActiveForm(frmdb); frmdb.DbConnectConfigure = info.DbConnectConfigure; } } }
private void NewConnectDb(DbConnectConfigure configure = null,ConnectInfo info = null, TreeNode node=null) { FrmOpenDb openDb = new FrmOpenDb(); DialogResult dr = openDb.ShowDialog(this); if (dr == DialogResult.Cancel) { return; } else { if (node == null) { node = new TreeNode(); tvConnectList.Nodes[0].Nodes.Add(node); } if (info==null) { info = new ConnectInfo(node); } node.Tag = info; info.DbConnectConfigure = openDb.DbConnectConfigure; if (dr == DialogResult.OK) { FrmDatabase frmdb = new FrmDatabase(openDb.DbClass); frmdb.DbConnectConfigure = info.DbConnectConfigure; info.FrmDataBase = frmdb; ShowOrActiveForm(frmdb); } info.Node = node; tvConnectList.ExpandAll(); SaveConnectInfos(); } }