Inheritance: IDisposable
Beispiel #1
0
 public void AddChild(FileSystemNode node)
 {
     Children.RemoveAll(child => child.Name.Equals(node.Name, StringComparison.InvariantCultureIgnoreCase));
     Children.Add(node);
     TouchLastWriteTime();
     TouchLastAccessTime();
 }
Beispiel #2
0
 internal void Move(FileSystemNode source, FolderNode destParentNode, string destName)
 {
     Children.Remove(source);
     source.Name = destName;
     destParentNode.AddChild(source);
 }
Beispiel #3
0
 internal void RemoveChild(FileSystemNode nodeToRemove)
 {
     nodeToRemove.VerifyCanBeRemoved();
     nodeToRemove.Dispose();
     if (Children.Remove(nodeToRemove) == false)
         throw new InvalidOperationException(string.Format("Trying to remove a node '{0}' that doesn't exist.", nodeToRemove));
     TouchLastWriteTime();
     TouchLastAccessTime();
 }
Beispiel #4
0
        private void MoveFileSystemItem(FileSystemNode sourceNode, RootedCanonicalPath destination)
        {
            var parser = new PathParser(destination.FullPath);
            var destParentNode = parser.GetParentNode(_rootNode);
            string destName = parser.GetLeafNodeName();

            sourceNode.MoveTo(destParentNode, destName);
        }