WEB开发网
开发学院软件开发Python python操作sharepoint对象模型 阅读

python操作sharepoint对象模型

 2010-09-22 11:27:22 来源:WEB开发网   
核心提示: PyListusing System;using System.Collections.Generic;using System.Text;using Microsoft.SharePoint;using System.Runtime.InteropServices;namespace P

PyList

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;
using System.Runtime.InteropServices;

namespace PySP
{
    [ComVisible(true)]
    public class PyList
    {
        protected SPList list = null;

        protected void EnsureList()
        {
            if (this.list == null)
                throw new NullReferenceException("the list object can't be null!");
        }

        public PyList() { }

        public PyList(SPList list)
        {
            this.list = list;
        }

        public string Title
        {
            get
            {
                EnsureList();
                return this.list.Title;
            }
            set
            {
                EnsureList();
                this.list.Title = value;
            }
        }

        public bool AllowContentTypes
        {
            get
            {
                EnsureList();
                return this.list.AllowContentTypes;
            }
        }

        public bool AllowDeletion
        {
            get
            {
                EnsureList();
                return this.list.AllowDeletion;
            }
        }

        public bool CanReceiveEmail
        {
            get
            {
                EnsureList();
                return this.list.CanReceiveEmail;
            }
        }

        public DateTime Created
        {
            get
            {
                EnsureList();
                return this.list.Created;
            }
        }

        public PyListItemCollection GetAllItems()
        {
            EnsureList();
            return new PyListItemCollection(this.list.Items);
        }
        public void Update()
        {
            EnsureList();
            this.list.Update();
        }
    }
}

上一页  1 2 3 4 5 6 7  下一页

Tags:python 操作 sharepoint

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接