SPContentType.Fields 属性

获取表示集合的内容类型中包含的列引用的SPFieldCollection

命名空间:  Microsoft.SharePoint
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
Public ReadOnly Property Fields As SPFieldCollection
    Get
用法
Dim instance As SPContentType
Dim value As SPFieldCollection

value = instance.Fields
public SPFieldCollection Fields { get; }

属性值

类型:Microsoft.SharePoint.SPFieldCollection
使用内容类型的列的集合。

备注

For more information about columns, see Introduction to Columns.

SPContentType对象包含SPFieldLinkCollectionSPFieldCollection对象。

因为它们存在于该内容类型, SPFieldCollection对象为开发人员提供一种方法来获取列的属性的组合的视图。每个SPField对象表示列或字段中,定义,与该内容类型字段引用中已重写这些属性合并所有的属性。

在访问内容类型中SPField时, SharePoint Foundation合并字段引用中,使用的字段定义,并生成SPField对象返回给您。这样可以防止开发人员不必查找字段定义,然后查找字段定义,通过该内容类型的字段引用的所有属性。

因此,没有SPFieldLinkCollectionSPFieldCollection对象中的项之间的 1-1 关联。对于每个SPFieldLink对象添加到内容类型, SharePoint Foundation添加一个代表该列的组合的视图,规定的内容类型中的相应SPField对象。

您无法直接添加或删除SPContentType对象 ; 中SPFieldCollection对象中的项目如果您尝试执行此操作,将引发错误。

另请参阅

引用

SPContentType 类

SPContentType 成员

Microsoft.SharePoint 命名空间

其他资源

Introduction to Columns

Adding Columns in Content Types to Lists

Introduction to Content Types

Site and List Content Types

Base Content Type Hierarchy