// ---------- CONSTRUCTORS ----------

        /// <summary>
        /// Creates a SharePointDocumentLibrary object from the underlying List object.
        /// </summary>
        /// <param name="list">The base List object representing this document library.</param>
        /// <param name="listItemCollection">A collection of ListItems that represents the items currently queried from the list.</param>
        /// <exception cref="System.ArgumentNullException">Thrown if a list or folder is not supplied.</exception>
        public SharePointDocumentLibrary(List list, ListItemCollection listItemCollection) : base(list, listItemCollection)
        {
            Folder = new SharePointFolder(list.RootFolder);
            SharePointClient.Load(list.RootFolder.Context, list.RootFolder);

            // Create the list of documents.
            foreach (ListItem item in listItemCollection)
            {
                documents.Add(new SharePointDocument(item));
            }
        }
Beispiel #2
0
        // ---------- CONSTRUCTORS ----------

        /// <summary>
        /// Creates a SharePointDocument object from the underlying ListItem object.
        /// </summary>
        /// <param name="listItem">The base ListItem object representing this document.</param>
        /// <exception cref="System.ArgumentNullException">Thrown if a list item is not supplied.</exception>
        public SharePointDocument(ListItem listItem) : base(listItem)
        {
            // Load various the objects and parameters needed into the context.
            SharePointClient.Load(listItem.Context, listItem.File);
            SharePointClient.Load(listItem.Context, listItem.File.ModifiedBy);
        }