public ExperimentsTree(string fileName, Guid id) { root = new ExperimentsTreeNode(id); root.Open(); root.Load(); root.Save(fileName); }
/// <summary> /// Depth-first search function /// </summary> /// <param name="id"></param> /// <returns>Experemnt object reference or NULL</returns> public ExperimentsTreeNode FindNode(Guid id) { int i = 0; ExperimentsTreeNode result = null; if (this.Id == id) { return(this); } else { if (childNodes.Count == 0) { return(null); } else { do { result = this.childNodes[i++].FindNode(id); } while (result == null && i < childNodes.Count); return(result); } } }
public Guid AddNewChild() { var child = new ExperimentsTreeNode(); AddChild(child); return(child.Id); }
public static ExperimentsTree Load(string fileName) { var tree = new ExperimentsTree(); tree.root = ExperimentsTreeNode.Load(fileName); return(tree); }
private void AddChild(ExperimentsTreeNode child) { child.level = this.level + 1; child.parentNode = this; child.IsLoaded = child.isOpen = true; childNodes.Add(child); }
public Guid AddNewChild() { var child = new ExperimentsTreeNode(); AddChild(child); return child.Id; }
private void AddChild(ExperimentsTreeNode child) { child.level = this.level + 1; child.parentNode = this; child.isOpen = true; childNodes.Add(child); }
public ExperimentsTree(string fileName) { root = new ExperimentsTreeNode(); root.Open(); root.Save(fileName); }