Share via


PolicyLabel class

Provides the policy ID for the PolicyLabel objects.

Inheritance hierarchy

System.Object
  Microsoft.Office.RecordsManagement.PolicyFeatures.PolicyLabel

Namespace:  Microsoft.Office.RecordsManagement.PolicyFeatures
Assembly:  Microsoft.Office.Policy (in Microsoft.Office.Policy.dll)

Syntax

'Declaration
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel := True)> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
Public Class PolicyLabel _
    Implements IPolicyFeature
'Usage
Dim instance As PolicyLabel
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public class PolicyLabel : IPolicyFeature

Examples

The following code example shows how to get a policy item's CustomData property. This example contains a chunk of XML that has information you can use to implement SharePoint information management features.

using Microsoft.Office.RecordsManagement.InformationPolicy; 

using (SPSite site = new SPSite(documentUrl)) 


{ 

     using (SPWeb web = site.OpenWeb()) 

     { 

       SPFile docFile = web.GetFile(documentUrl); 

       Policy docPolicy = Policy.GetPolicy(docFile.Item.ContentType); 

       PolicyItem docPolicyItem = docPolicy.Items["Microsoft.Office.RecordsManagement.PolicyFeatures.PolicyLabel"]; 

       return docPolicyItem.CustomData; 

     } 

}

Thread safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See also

Reference

PolicyLabel members

Microsoft.Office.RecordsManagement.PolicyFeatures namespace