/// <summary> /// Add mapping. /// </summary> /// <param name="mapping"></param> /// <param name="remainingPathParts"></param> protected void Add(FileSystemMapping mapping, Queue<string> remainingPathParts) { // if there are more path parts then add another child node else add a new leaf node if (remainingPathParts.Count > 0) { // get current path part string pathPart = remainingPathParts.Dequeue(); // create child node var childNode = new FileSystemChildNode(pathPart); // add child node this.AddChildNode(childNode); // add remaining path childNode.Add(mapping, remainingPathParts); } else { // create leaf node var leafNode = new FileSystemLeafNode(mapping.FileSystem); // add leaf node this.AddLeafNode(leafNode); } }
/// <summary> /// Add mapping. /// </summary> /// <param name="mapping"></param> /// <param name="remainingPathParts"></param> protected void Add(FileSystemMapping mapping, Queue <string> remainingPathParts) { // if there are more path parts then add another child node else add a new leaf node if (remainingPathParts.Count > 0) { // get current path part string pathPart = remainingPathParts.Dequeue(); // create child node var childNode = new FileSystemChildNode(pathPart); // add child node this.AddChildNode(childNode); // add remaining path childNode.Add(mapping, remainingPathParts); } else { // create leaf node var leafNode = new FileSystemLeafNode(mapping.FileSystem); // add leaf node this.AddLeafNode(leafNode); } }
public AggregateFileSystem(IEnumerable <FileSystemMapping> fileSystems) { // file systems mappings _fileSystems = fileSystems; // create tree _rootNode = new FileSystemChildNode(string.Empty); _rootNode.Add(fileSystems); }
public AggregateFileSystem(IEnumerable<FileSystemMapping> fileSystems) { // file systems mappings _fileSystems = fileSystems; // create tree _rootNode = new FileSystemChildNode(string.Empty); _rootNode.Add(fileSystems); }