예제 #1
0
        private FileInfo PrepareFileOperation(SeriesFolder destination)
        {
            if (destination == null)
            {
                throw new ArgumentNullException("Destination can not be null.");
            }
            if (!File.Exists)
            {
                throw new ArgumentException("Source File must exist on the file system.");
            }
            var tvo = destination.ViewModelProxy as ITreeViewDisplayable;

            if (tvo != null && Size > (tvo.Parent as VideoFileStorageDevice).AvailableFreeSpace)
            {
                throw new IOException("There is not enough available space on the storage device.");
            }
            if (!destination.Directory.Exists)
            {
                destination.CreateDirectory();
            }
            return(new FileInfo(string.Format(@"{0}\{1}", destination.Directory.FullName, File.Name)));
        }
예제 #2
0
 public void CopyTo(SeriesFolder destination)
 {
     File.CopyTo(PrepareFileOperation(destination).FullName, true);
 }
예제 #3
0
 private FileInfo PrepareFileOperation(SeriesFolder destination)
 {
     if (destination == null)
         throw new ArgumentNullException("Destination can not be null.");
     if (!File.Exists)
         throw new ArgumentException("Source File must exist on the file system.");
     var tvo = destination.ViewModelProxy as ITreeViewDisplayable;
     if (tvo != null && Size > (tvo.Parent as VideoFileStorageDevice).AvailableFreeSpace)
         throw new IOException("There is not enough available space on the storage device.");
     if (!destination.Directory.Exists)
         destination.CreateDirectory();
     return new FileInfo(string.Format(@"{0}\{1}", destination.Directory.FullName, File.Name));
 }
예제 #4
0
 public void MoveTo(SeriesFolder destination)
 {
     File.MoveTo(PrepareFileOperation(destination).FullName);
 }
예제 #5
0
 public void CopyTo(SeriesFolder destination)
 {
     File.CopyTo(PrepareFileOperation(destination).FullName, true);
 }
예제 #6
0
 public void MoveTo(SeriesFolder destination)
 {
     File.MoveTo(PrepareFileOperation(destination).FullName);
 }