This project is read-only.

Scribd.Net.Document.AddToCollection(s) method

Adds the document to the specified Collection or list of Collections.

Signature(s)

  • public void AddToCollection(User user, int collectionId)
  • public void AddToCollections(System.Collections.Generic.ICollection<int> collectionIDs)
  • public void AddToCollections(User user, System.Collections.Generic.ICollection<int> collectionIDs)

Parameter(s)

  • User user: If non-null then request is made on the behalf of this user. Otherwise the current User is assumed.
  • int collectionId: The Id of the collection to which to add this document
  • System.Collections.Generic.ICollection<int> collectionIDs: Add the document to each of the collections in this set

Return Value

  • none

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 all my docs to the Collection "ScribdRocks". A silly example.
            foreach (Scribd.Net.Collection C in myCollections) {
                if (string.Equals(C.Name, "ScribdRocks"))
                {
                    foreach (Scribd.Net.Document doc in sourceDocuments)
                    {
                        doc.AddToCollection(Scribd.Net.Service.User, C.ID);
                    }
                }
            }


See Also

Last edited Aug 11, 2010 at 1:29 AM by peterjp, version 7

Comments

No comments yet.