private void updateTreeNodes(DbTreeNode node, bool childnode) { IPgDatabase db = PgDatabase.Interface; db.PgConnection = this.findConnection(); if (node.Nodes.Count > 0) { if (!childnode) { updateNodes(node, childnode); } } else { node.Nodes.AddRange(this.createNodesFromMetaObject(node.metaObj, childnode).ToArray()); } }
private void InitTree() { IPgDatabase db = PgDatabase.Interface; db.PgConnection = findConnection(); if (!db.IsConnectionLife) { return; } IDataSourceMetadata meta = new SqlMetadataImpl(db); MetaObject root = meta.GetRoot().First <MetaObject>(); DbTreeNode rootNode = new DbTreeNode(root.type, root.value); rootNode.metaObj = root; this.updateTreeNodes(rootNode, true); this.addPanel(); // foreach schema get tables. dbStructure.Nodes.Add(rootNode); }
private void picTest_Click(object sender, EventArgs e) { Cursor = Cursors.WaitCursor; IPgDatabase db = PgDatabase.Interface; IPgConnection tmp = db.PgConnection; db.PgConnection = CincoConnection; if (db.IsConnectionLife) { picTest.Image = imageList.Images[2]; } else { picTest.Image = imageList.Images[1]; } _OrgConnection = CincoConnection; db.PgConnection = tmp; Cursor = Cursors.Default; }
public SqlMetadataImpl(IPgDatabase database) { this._database = database; }