Exemplo 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);
            }
        }
Exemplo n.º 3
0
 protected void AddLeafNode(FileSystemLeafNode leafNode)
 {
     this.ChildLeaves.Add(leafNode);
     return;
 }
 protected void AddLeafNode(FileSystemLeafNode leafNode)
 {
     this.ChildLeaves.Add(leafNode);
     return;
 }