Represent an album

Namespace:  IpernityNET.IpernityObjects
Assembly:  IpernityNET (in IpernityNET.dll) Version: 0.3.1.0 (0.3.1.0)

Syntax

C#
public class Album : IpernityObject
Visual Basic (Declaration)
Public Class Album _
	Inherits IpernityObject
Visual C++
public ref class Album : public IpernityObject

Examples

CopyC#
static void Main(string[] args)
{
    Ipernity ipernity = new Ipernity("apiKey", "apiSecret");
    ipernity.AlwaysSign = true;
    try
    {
        Account account = ipernity.AuthGetAccount("token");
        // authenticate the nex method to call
        account.Authenticate = true;
        // get all albums. As the method is authenticated, we get all albums, even the private
        account.UserInfos.AlbumGetList();
        Album album = account.UserInfos.Albums.Values.First();
        //Create a document
        Document doc = new Document(123456);
        ipernity.ConfigureIpernityObject(doc);
        // add the document to the album
        DocumentAddResult addResult = album.DocsAdd(doc);
        // get albums infos, and get the cover thumbnail
        album.Get(Thumbsize.OneHundred);
        // access to the cover and get the thumbnail url
        Console.WriteLine("Thumbnail URL : {0}", album.Cover.Medias.Thumbnails[Thumbsize.OneHundred].Url);
        // create an other document
        doc = new Document(654321);
        ipernity.ConfigureIpernityObject(doc);
        // edit the album and set a new cover. As the doc does not belong to this album, it is added;
        album.Edit("New title", "New description", doc.Id);
        // get visitors
        IEnumerable>Visitor< visitors = album.GetVisitors();
        // set permissions
        alb.SetPerms(PermissionPeople.Family);
        // get the context of a document. Get 1 previous and  next
        DocumentContext context = album.DocsGetContext(doc, 1, 1);
        // get the list of documents
        IEnumerable>Document< listDocs = album.DocsGetList();
        Document doc1 = new Document(659874);
        Document doc2 = new Document(145879);
        ipernity.ConfigureIpernityObject(doc1);
        ipernity.ConfigureIpernityObject(doc2);
        // set a new list of document, and set doc2 as cover
        addResult = album.DocsSetList(new Document[] {doc1, doc2}, doc2);
        // remove a doc
        RemoveDocsResults removeResult = album.DocsRemove(doc1);   
        // delete the album
        album.Delete();
    }
    catch(IpernityException ex)
    {
        Console.WriteLine("Ipernity returned an error : {0}", ex.Message);
    }
}

Inheritance Hierarchy

System..::.Object
  IpernityNET.IpernityObjects..::.IpernityObject
    IpernityNET.IpernityObjects..::.Album

See Also