属性包架构

上次修改时间: 2010年12月22日

适用范围: SharePoint Foundation 2010

元素清单可以定义文件、文件夹、列表项或网站的属性包。

以下是"属性包"架构中的元素的列表。

<Elements>

   <PropertyBag>

    <Property>

示例

以下示例演示如何将 Location 属性及其值添加到表示外地办事处的网站的属性包。

<PropertyBag HyperlinkBaseUrl="https://contoso.com/sites/EastEnglandSalesOffice"" Url="" ParentType="Web" RootWebOnly=TRUE" />
    <Property Name="Location" Value="London" Type="string" />
</PropertyBag>

以下示例演示如何将 DaysToLive 属性及其值添加到表示临时价格折扣的列表项的属性包。该属性指定在从列表中删除第二十三个列表项之前,该项应保存的天数。请注意,Type 属性的值必须是 PropertyBagType 枚举的成员。因此,在该示例中,它必须是"int",而不是"integer"。

<PropertyBag HyperlinkBaseUrl="https://contoso.com/sites/EastEnglandSalesOffice"" Url="Lists/CurrentDiscounts" ParentType="ListItem" ItemIndex="23"/>
    <Property Name="DaysToLive" Value="90" Type="int" />
</PropertyBag>