コード例 #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);
        }
コード例 #2
0
ファイル: TreeDirectory.cs プロジェクト: peterlanoie/netfx-io
 private TreeDirectory(string path, TreeEntry parent, Func <string, bool> includeChildPredicate)
     : base(new DirectoryInfo(path), parent)
 {
     _includeChildPredicate = includeChildPredicate;
 }
コード例 #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++;
 }
コード例 #4
0
ファイル: TreeFile.cs プロジェクト: peterlanoie/netfx-io
 internal TreeFile(string filename, TreeEntry parent)
     : base(new FileInfo(filename), parent)
 {
 }