//Dennis: Fires when saving or opening a file. void IFileData.SaveToStream(Stream destination) { try { if (destination == null) { FileSystemDataModule.OpenFileWithDefaultProgram(FullName); } else { FileSystemDataModule.CopyFileToStream(FullName, destination); } } catch (Exception exc) { throw new UserFriendlyException(exc); } }
//Dennis: Fires when saving or opening a file. void IFileData.SaveToStream(Stream destination) { try { if (!string.IsNullOrEmpty(RealFileName)) { if (destination == null) { FileSystemDataModule.OpenFileWithDefaultProgram(RealFileName); } else { FileSystemDataModule.CopyFileToStream(RealFileName, destination); } } else if (TempSourceStream != null) { FileSystemDataModule.CopyStream(TempSourceStream, destination); } } catch (DirectoryNotFoundException exc) { throw new UserFriendlyException(exc); } catch (FileNotFoundException exc) { throw new UserFriendlyException(exc); } }