void AddSchemaTree(LoadableTable table, TreeListNode parentNode) { var node = schemaTree.AppendNode(new object[] { table.Schema.Name, null }, parentNode, table); tableNodes.Add(node, table); foreach (var child in table.Schema.ChildRelations.Select(cr => schemaTables[cr.ChildSchema])) { AddSchemaTree(child, node); } }
void LoadTable(LoadableTable table, Action callback = null) { var nodes = GetNodes(table).ToArray(); table.Load(delegate { string caption = table.Table.Rows.Count == 1 ? "1 Row" : table.Table.Rows.Count + " Rows"; foreach (var node in nodes) { node.SetValue(colContent, caption); } UpdateLoadAllButton(); if (callback != null) { callback(); } }); schemaTree.HideEditor(); schemaTree.InvalidateNodes(); UpdateLoadAllButton(); }
IEnumerable <TreeListNode> GetNodes(LoadableTable table) { return(tableNodes.Where(kvp => kvp.Value == table).Select(kvp => kvp.Key)); }
void LoadTable(LoadableTable table, Action callback = null) { var nodes = GetNodes(table).ToArray(); table.Load(delegate { string caption = table.Table.Rows.Count == 1 ? "1 Row" : table.Table.Rows.Count + " Rows"; foreach (var node in nodes) node.SetValue(colContent, caption); UpdateLoadAllButton(); if (callback != null) callback(); }); schemaTree.HideEditor(); schemaTree.InvalidateNodes(); UpdateLoadAllButton(); }
IEnumerable<TreeListNode> GetNodes(LoadableTable table) { return tableNodes.Where(kvp => kvp.Value == table).Select(kvp => kvp.Key); }
void AddSchemaTree(LoadableTable table, TreeListNode parentNode) { var node = schemaTree.AppendNode(new object[] { table.Schema.Name, null }, parentNode, table); tableNodes.Add(node, table); foreach (var child in table.Schema.ChildRelations.Select(cr => schemaTables[cr.ChildSchema])) AddSchemaTree(child, node); }