public FileTree(string rootPath) { _rootPath = rootPath; Siblings = new List <FilesystemElement>(); foreach (var file in Directory.GetFileSystemEntries(rootPath)) { var newSibling = new FilesystemElement(file, this); Siblings.Add(newSibling); } }
private void Initialize(string path) { if (IsDir) { var files = Directory.GetFileSystemEntries(path); foreach (var file in files) { var newSibling = new FilesystemElement(file, _treeRoot); Siblings.Add(newSibling); } } else { VirtualPath = ToVirtualPath(path); } }
public void Insert(string path) { var newElement = new FilesystemElement(path, this); Siblings.Add(newElement); }