Exemple #1
0
 public FacebookPhoto(photo newPhoto, String newPath)
 {
     pid = newPhoto.pid;
     path = newPath;
 }
Exemple #2
0
 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;
 }
Exemple #3
0
 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));
 }
Exemple #4
0
 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;
 }