/// <summary> /// Performs the specified <paramref name="action"/> on all parents of the entry. /// Returns the root entry. /// </summary> /// <param name="action"></param> /// <returns></returns> private TreeEntry ForAllParents(Action <TreeEntry> action) { TreeEntry objNode = this; while (objNode.Parent != null) { objNode = objNode.Parent; if (action != null) { action(objNode); } } return(objNode); }
private TreeDirectory(string path, TreeEntry parent, Func <string, bool> includeChildPredicate) : base(new DirectoryInfo(path), parent) { _includeChildPredicate = includeChildPredicate; }
/// <summary> /// Creates a new tree entry. /// </summary> /// <param name="info">The entry's file system info.</param> /// <param name="parent">The optional parent node of the tree entry.</param> public TreeEntry(FileSystemInfo info, TreeEntry parent) { Info = info; Parent = parent; NodeId = this.RootEntry._nextNodeIndex++; }
internal TreeFile(string filename, TreeEntry parent) : base(new FileInfo(filename), parent) { }