Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
 private TreeDirectory(string path, TreeEntry parent, Func <string, bool> includeChildPredicate)
     : base(new DirectoryInfo(path), parent)
 {
     _includeChildPredicate = includeChildPredicate;
 }
Ejemplo n.º 3
0
 /// <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++;
 }
Ejemplo n.º 4
0
 internal TreeFile(string filename, TreeEntry parent)
     : base(new FileInfo(filename), parent)
 {
 }