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))); }
public void CopyTo(SeriesFolder destination) { File.CopyTo(PrepareFileOperation(destination).FullName, true); }
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)); }
public void MoveTo(SeriesFolder destination) { File.MoveTo(PrepareFileOperation(destination).FullName); }