예제 #1
0
        public static SharepointObject Read(SharepointSession session, ObjectId id)
        {
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }
            if (id == null)
            {
                throw new ArgumentNullException("id");
            }
            SharepointSiteId sharepointSiteId = id as SharepointSiteId;

            if (sharepointSiteId == null)
            {
                throw new ArgumentException("id");
            }
            if (sharepointSiteId is SharepointDocumentLibraryItemId)
            {
                return(SharepointDocumentLibraryItem.Read(session, sharepointSiteId));
            }
            if (sharepointSiteId is SharepointListId)
            {
                return(SharepointList.Read(session, sharepointSiteId));
            }
            throw new ObjectNotFoundException(sharepointSiteId, Strings.ExObjectNotFound(sharepointSiteId.ToString()));
        }
        public SharepointDocumentLibraryItem Read(ObjectId objectId, params PropertyDefinition[] propsToReturn)
        {
            if (objectId == null)
            {
                throw new ArgumentNullException("objectId");
            }
            SharepointItemId sharepointItemId = objectId as SharepointItemId;
            SharepointListId sharepointListId = base.Id as SharepointListId;

            if (sharepointItemId == null)
            {
                throw new ArgumentException("objectId as SharepointItemId");
            }
            if (sharepointItemId.ListName != sharepointListId.ListName || sharepointItemId.SiteUri != sharepointListId.SiteUri)
            {
                throw new ObjectNotFoundException(objectId, Strings.ExObjectNotFound(objectId.ToString()));
            }
            return(SharepointDocumentLibraryItem.Read(this.Session, objectId));
        }
예제 #3
0
        public new static SharepointDocumentLibraryFolder Read(SharepointSession session, ObjectId objectId)
        {
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }
            if (objectId == null)
            {
                throw new ArgumentNullException("objectId");
            }
            SharepointDocumentLibraryItemId sharepointDocumentLibraryItemId = objectId as SharepointDocumentLibraryItemId;

            if (sharepointDocumentLibraryItemId == null)
            {
                throw new ArgumentException("objectId");
            }
            if (sharepointDocumentLibraryItemId.UriFlags != UriFlags.SharepointFolder)
            {
                throw new ArgumentException("objectId");
            }
            return((SharepointDocumentLibraryFolder)SharepointDocumentLibraryItem.Read(session, objectId));
        }
예제 #4
0
        public new static SharepointDocument Read(SharepointSession session, ObjectId id)
        {
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }
            if (id == null)
            {
                throw new ArgumentNullException("id");
            }
            SharepointDocumentLibraryItemId sharepointDocumentLibraryItemId = id as SharepointDocumentLibraryItemId;

            if (sharepointDocumentLibraryItemId == null)
            {
                throw new ArgumentException("id");
            }
            if (sharepointDocumentLibraryItemId.UriFlags != UriFlags.SharepointDocument)
            {
                throw new ArgumentException("id");
            }
            return((SharepointDocument)SharepointDocumentLibraryItem.Read(session, id));
        }