Ejemplo n.º 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)));
        }
Ejemplo n.º 2
0
 public void CopyTo(SeriesFolder destination)
 {
     File.CopyTo(PrepareFileOperation(destination).FullName, true);
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 4
0
 public void MoveTo(SeriesFolder destination)
 {
     File.MoveTo(PrepareFileOperation(destination).FullName);
 }
Ejemplo n.º 5
0
 public void CopyTo(SeriesFolder destination)
 {
     File.CopyTo(PrepareFileOperation(destination).FullName, true);
 }
Ejemplo n.º 6
0
 public void MoveTo(SeriesFolder destination)
 {
     File.MoveTo(PrepareFileOperation(destination).FullName);
 }