博客地址:http://blog.csdn.net/FoxDave
SharePoint文档库关于版本的设置:“Versioning Settings”,可以通过CSOM用List对象的一些属性去设置它。
Content Approval部分:
Specify whether new items or changes to existing items should remain in a draft state until they have been approved.
对应的属性为list.EnableModeration
布尔类型,true为Yes,false为No。
Document Version History部分:
Specify whether a version is created each time you edit a file in this document library.
Create a version each time you edit a file in this document library:
对应的属性为list.EnableVersioning和list.EnableMinorVersions
布尔类型。No versioning时,两个属性均为false;Create major versions时,EnableVersioning为ture,EnableMinorVersions为false;Create major and minor (draft) versions时,两个属性均为true。
Optionally limit the number of versions to retain:
Keep the following number of major versions:
对应的属性为list.MajorVersionLimit
整型,主要版本的保存数量限制
Keep drafts for the following number of major versions:
对应的属性为list.MajorWithMinorVersionsLimit
整型,次要版本(或主要版本草稿)的保存数量限制
Draft Item Security部分:
Drafts are minor versions or items which have not been approved. Specify which users should be able to view drafts in this document library.
对应的属性为list.DraftVersionVisibility
枚举类型,对应DraftVisibilityType(Reader、Author和Approver),分别表示设置的三个选项。
Require Check Out部分:
Specify whether users must check out documents before making changes in this document library.
对应的属性为list.ForceCheckout
布尔类型,true为Yes,false为No。
以上就是版本设置相关的CSOM属性,可以用来方便地获取与设置库的版本设置。