Exemplo n.º 1
0
        public IEnumerable <ITreeNode> GetChildren(bool refresh)
        {
            ITreeNode[] treeNodes;

            try
            {
                var dataTable  = connection.GetOleDbSchemaTable(OleDbSchemaGuid.Catalogs, null);
                var count      = dataTable.Rows.Count;
                var nameColumn = dataTable.Columns["CATALOG_NAME"];
                treeNodes = new ITreeNode[count];

                for (var i = 0; i < count; i++)
                {
                    var name = (string)dataTable.Rows[i][nameColumn];
                    treeNodes[i] = new CatalogNode(connection, name);
                }
            }
            catch
            {
                treeNodes    = new ITreeNode[1];
                treeNodes[0] = new CatalogNode(connection, null);
            }

            return(treeNodes);
        }
Exemplo n.º 2
0
 public SchemaNode(CatalogNode catalog, string name)
 {
     Catalog = catalog;
     Name    = name;
 }