public FacebookPhoto(photo newPhoto, String newPath) { pid = newPhoto.pid; path = newPath; }
private Boolean IsPhotoDownloaded(photo DownloadedPhoto) { try { foreach (String filename in Directory.GetFiles(parent.UpPhotoPath() + FacebookInterfaces.AlbumName(new AID(DownloadedPhoto.aid)))) { Image b = Image.FromFile(filename); if (b.Equals(DownloadedPhoto.picture_big)) { return true; } } } catch (DirectoryNotFoundException) { return false; } return false; }
private void SaveDownloadedPhoto(photo DownloadedPhoto, String path) { Directory.CreateDirectory(StringUtils.GetFullFolderPathFromPath(path)); System.Drawing.Bitmap imageData = new System.Drawing.Bitmap((System.Drawing.Bitmap)DownloadedPhoto.picture_big.Clone()); parent.WatchersIgnoreFile(path); imageData.Save(path, ImageFormat.Png); parent.WatchersUnIgnoreFile(path); parent.AddUploadedPhoto(new FacebookPhoto(DownloadedPhoto, path)); }
private String GeneratePath(photo DownloadedPhoto) { int PhotoCounter = 1; String albumName = FacebookInterfaces.AlbumName(new AID(DownloadedPhoto.aid)); String upPhotoPath = parent.UpPhotoPath(); String path = upPhotoPath + albumName + @"\Photo " + PhotoCounter.ToString() + DownloadedPhotoExtension; while (File.Exists(path)) { PhotoCounter++; path = upPhotoPath + albumName + @"\Photo " + PhotoCounter.ToString() + DownloadedPhotoExtension; } return path; }