Exemple #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);
            }
        }
Exemple #3
0
        /// <summary>
        /// Add file system mapping.
        /// </summary>
        /// <param name="mapping"> File system mapping. </param>
        public void Add(FileSystemMapping mapping)
        {
            // get path parts
            var pathParts = this.GetPathParts(mapping.Path);

            // add mapping
            Add(mapping, pathParts);
        }
        /// <summary>
        /// Add file system mapping.
        /// </summary>
        /// <param name="mapping"> File system mapping. </param>
        public void Add(FileSystemMapping mapping)
        {
            // get path parts
            var pathParts = this.GetPathParts(mapping.Path);

            // add mapping
            Add(mapping, pathParts);
        }