Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 5
0
        protected void AddChildNode(FileSystemChildNode childNode)
        {
            List <FileSystemChildNode> children;

            if (this.Children.TryGetValue(childNode.Name, out children) == false)
            {
                children = new List <FileSystemChildNode>();
                this.Children.Add(childNode.Name, children);
            }

            children.Add(childNode);
        }
        protected void AddChildNode(FileSystemChildNode childNode)
        {
            List<FileSystemChildNode> children;

            if (this.Children.TryGetValue(childNode.Name, out children) == false)
            {
                children = new List<FileSystemChildNode>();
                this.Children.Add(childNode.Name, children);
            }

            children.Add(childNode);
        }