Ejemplo n.º 1
0
 /// <summary>
 /// Retrieves a list of comments for an album
 /// </summary>
 /// <param name="Associative">Returns an associative array</param>
 /// <param name="LastUpdated">Return results where LastUpdated is after the epoch time provided</param>
 /// <param name="SitePassword">The site password for a specific user</param>
 public void GetComments(bool Associative, int LastUpdated, string SitePassword)
 {
     CommunicationHelper ch = new CommunicationHelper();
     // SessionID [required], AlbumID [required], Key [required], Password, Associative, Callback, LastUpdated, Pretty, SitePassword, Strict
     AlbumResponse resp = new AlbumResponse();
     if ((this != null) && !(string.IsNullOrEmpty(this.Password)))
         resp = ch.ExecuteMethod<AlbumResponse>("smugmug.albums.comments.get", basic, "AlbumID", id, "AlbumKey", Key, "SitePassword", SitePassword, "Password", Password, "LastUpdated", LastUpdated, "Associative", Associative);
     else
         resp = ch.ExecuteMethod<AlbumResponse>("smugmug.albums.comments.get", basic, "AlbumID", id, "AlbumKey", Key, "SitePassword", SitePassword, "LastUpdated", LastUpdated, "Associative", Associative);
     if (resp.stat == "ok")
     {
         //Hack: The class has 2 properties with the same name - Comments. I've separated them in 2 different properties (HasComments and CommentsList)
         if (this.CommentsList == null)
             this.CommentsList = new List<Comment>();
         this.CommentsList = (List<Comment>)resp.Album.Comments;
     }
     else
     {
         Console.WriteLine(resp.message);
         throw new SmugMugException(resp.code, resp.message, resp.method);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Retrieves the details for a specified album (id, Key, Backprinting, CanRank, CategoryID and Name, Clean, ColorCorrection, Comments, CommunityID and Name, Description, EXIF, External, FamilyEdit, FriendEdit, Geography, Header, HideOwner, HighlightID and Key, ImageCount, Larges, LastUpdated, NiceName, Originals, Password, PasswordHint, Position, Printable, ProofDays, Protected, Public, Share, SmumugSearchable, SortDirection, SortMethod, SquareThumbs, SubCategoryID and Name, TemplateID, ThemeID and Name and Type, Title, Unique, UnsharpAmount, UnsharpRadius, UnsharpSigma, UnsharpThreshold, WatermarkID and Name, Watermarking, WorldSearchable, X2Larges, X3Larges, XLarges)
 /// </summary>
 /// <param name="SitePassword">The site password for a specific user</param>
 /// <returns></returns>
 public Album GetInfo(string SitePassword)
 {
     CommunicationHelper ch = new CommunicationHelper();
     // SessionID [required], AlbumID [required], AlbumKey [required], Callback, Password, Pretty, Sandboxed, SitePassword, Strict
     AlbumResponse resp = new AlbumResponse();
     if (!String.IsNullOrEmpty(this.Password))
         resp = ch.ExecuteMethod<AlbumResponse>("smugmug.albums.getInfo", basic, "AlbumID", id, "AlbumKey", Key, "SitePassword", SitePassword, "Password", Password);
     else
         resp = ch.ExecuteMethod<AlbumResponse>("smugmug.albums.getInfo", basic, "AlbumID", id, "AlbumKey", Key, "SitePassword", SitePassword);
     if (resp.stat == "ok")
     {
         var myAlbum= resp.Album;
         myAlbum.basic = basic;
         //Hack: The class has 2 properties with the same name - Comments. I've separated them in 2 different properties (HasComments and CommentsList)
         if (myAlbum.Comments != null)
             myAlbum.HasComments = (bool)myAlbum.Comments;
         return myAlbum;
     }
     else
     {
         Console.WriteLine(resp.message);
         throw new SmugMugException(resp.code, resp.message, resp.method);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Populate the current album with info from the site (id, Key, Backprinting, CanRank, CategoryID and Name, Clean, ColorCorrection, Comments, CommunityID and Name, Description, EXIF, External, FamilyEdit, FriendEdit, Geography, Header, HideOwner, HighlightID and Key, ImageCoutn, Larges, Originals, Password, PasswordHint, Position, Printable, ProofDays, Protected, Public, Share, SmumugSearchable, SortDirection, SortMethod, SquareThumbs, SubCategoryID and Name, TemplateID, ThemeID and Name and Type, Title, Unique, UnsharpAmount, UnsharpRadius, UnsharpSigma, UnsharpThreshold, WatermarkID and Name, Watermarking, WorldSearchable, X2Larges, X3Larges, XLarges)
 /// </summary>
 public async Task PopulateAlbumWithInfoFromSiteAsync(string SitePassword)
 {
     CommunicationHelper ch = new CommunicationHelper();
     // SessionID [required], AlbumID [required], AlbumKey [required], Callback, Password, Pretty, SitePassword, Strict
     AlbumResponse resp = new AlbumResponse();
     if (!String.IsNullOrEmpty(this.Password))
         resp = await ch.ExecuteMethod<AlbumResponse>("smugmug.albums.getInfo", basic, "AlbumID", id, "AlbumKey", Key, "SitePassword", SitePassword, "Password", Password);
     else
         resp = await ch.ExecuteMethod<AlbumResponse>("smugmug.albums.getInfo", basic, "AlbumID", id, "AlbumKey", Key, "SitePassword", SitePassword);
     if (resp.stat == "ok")
     {
         PopulateWithResponse(resp.Album, this, "HasComments", "CommentsList", "Comments");
         //Hack: The class has 2 properties with the same name - Comments. I've separated them in 2 different properties (HasComments and CommentsList)
         if (resp.Album.Comments != null)
             this.HasComments = (bool)resp.Album.Comments;
     }
     else
     {
         Console.WriteLine(resp.message);
         throw new SmugMugException(resp.code, resp.message, resp.method);
     }
 }