Scribd.Net.Category.GetCollections method

Retrieves Collection information for the specified User from Scribd.

Signature(s)

  • public static GetCollections(Scope scope)
  • public static GetCollections(User user, Scope scope)

Parameter(s)

  • Scope scope: Whether to retrieve info for public or private collections, or both.
  • User user: If specified, the retrieve collection data for this user. If null then retrieve data for the logged in user.

Return Value

  • System.Collection.Generic.ICollection<Collection> : A group of Collections

Usage Example

            // Get all the private collections of this user
            System.Collections.Generic.ICollection<Scribd.Net.Collection> myCollections = Scribd.Net.Collection.GetCollections(Scribd.Net.Collection.Scope.Private);

            // Get list of my documents.
            System.Collections.Generic.List<Scribd.Net.Document> sourceDocuments = Scribd.Net.Service.User.Documents;

            // add every one of my documents to all of my private collections. Silly, but an example.
            foreach (Scribd.Net.Collection C in myCollections) {
                if (string.Equals(C.Name, "ScribdRocks"))
                {
                    // add all my Docs to this collection
                    foreach (Scribd.Net.Document doc in sourceDocuments)
                    {
                        doc.AddToCollection(Scribd.Net.Service.User, C.ID);
                    }
                }
            }         


See Also

Last edited Aug 11, 2010 at 3:40 AM by peterjp, version 1

Comments

No comments yet.