示例#1
0
 public FrmMain()
 {
     Visible = false;
     InitializeComponent();
     Def.FrmMain = this; //Implicitly initialises the Def class
     Def.PbBase = this.PbBase;
     Def.PanelMain = this.PanelMain;
     Def.ToolBar = this.ToolBar;
     Def.Schema = new Schema();
     Def.Tree = new Tree();
     //for (int i = 0; i < ToolBar.Items.Count; ++i)
     //    ToolBar.Items[i].Enabled= true;
     Def.Schema.Tree = Def.Tree;
     Def.Tree.Schema = Def.Schema;
     Database db = new Database(Database.DriverEnum.PostgreSQL);
     Def.Db = db;
     Def.Db.ConStr = "DRIVER={" + Def.DbDriver + "};UID=" + Def.DbUser + ";SERVER=" + Def.DbServer + ";Port=" + Def.DbPort + ";Database=" + Def.DbDatabase + ";Password=" + Def.DbPassword;
     Def.Db.Connect();
     Def.TreeCanBeDisplayed = false;
 }
示例#2
0
 private void init()
 {
     Def.ExperimentRunning = true;
     Def.Schema = new Schema();
     Def.Tree = new Tree();
     Def.Schema.Tree = Def.Tree;
     Def.Tree.Schema = Def.Schema;
     Database db = new Database(Database.DriverEnum.PostgreSQL);
     Def.Db = db;
     Def.Db.ConStr = "DRIVER={" + Def.DbDriver + "};UID=" + Def.DbUser + ";SERVER=" + Def.DbServer + ";Port=" + Def.DbPort + ";Database=" + Def.DbDatabase + ";Password=" + Def.DbPassword;
     Def.Db.Connect();
 }