public ITable GetTable(params string[] path) { TableTree tree = this; foreach (var p in path) { if (tree == null) { break; } tree = tree.GetChildNodeTable(p); } return(tree == null ? null : tree.Table); }
public bool ContainTable(params string[] path) { TableTree tree = this; bool ret = false; foreach (var p in path) { if (tree.ContainChildNodeTable(p)) { tree = tree.GetChildNodeTable(p); ret = true; } else { return(false); } } return(ret); }
public void AddTable(ITable table, params string[] path) { TableTree tree = this; var length = path.Length - 1; for (int i = 0; i < length; i++) { if (tree.ContainChildNodeTable(path[i])) { tree = tree.GetChildNodeTable(path[i]); } else { tree = tree.AddChildNodeTable(path[i]); } } if (length > 0) { tree.AddChildNodeTable(path[length], table); } }