AreaManager 类 (Microsoft.SharePoint.Portal.SiteData)

已过时。  

Manages areas.

命名空间: Microsoft.SharePoint.Portal.SiteData
程序集: Microsoft.SharePoint.Portal (在 microsoft.sharepoint.portal.dll 中)

语法

声明
<ObsoleteAttribute("This class is obsolete.")> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel:=True)> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel:=True)> _
Public Class AreaManager
用法
Dim instance As AreaManager
[ObsoleteAttribute("This class is obsolete.")] 
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel=true)] 
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel=true)] 
public class AreaManager

备注

Areas are classifications for grouping content by user-defined criteria.

If a user instantiates a keyword area to call an AddKeyword or RemoveKeyword method, the user must acquire the keyword instance by using the SystemArea.Keyword object.

示例

The following code example shows the use of the AreaManager class.

Private siteUrl As New Uri("https://server/")
Private tm As New TopologyManager()
Private site As PortalSite = tm.PortalSites(siteUrl)
Private portalContext As PortalContext = PortalApplication.GetContext(site)
      
' get the topics area
Private guidTopics As Guid = AreaManager.GetSystemAreaGuid(portalContext, SystemArea.Topics)
Private areaTopics As Area = AreaManager.GetArea(portalContext, guidTopics)
Uri siteUrl = new Uri("https://server/");
TopologyManager tm = new TopologyManager();
PortalSite site = tm.PortalSites[siteUrl];
PortalContext portalContext = PortalApplication.GetContext(site);

// Get the topics area
Guid guidTopics = AreaManager.GetSystemAreaGuid(portalContext, SystemArea.Topics);
Area areaTopics = AreaManager.GetArea(portalContext, guidTopics);

Following is an example that acquires the keyword instance.

TopologyManager topologyManager = new TopologyManager();
Uri uri = new Uri("http://MyPortal");
PortalSiteCollection sites = topologyManager.PortalSites;
PortalContext portalContext = PortalApplication.GetContext(sites[uri]);
Guid keywordGuid = AreaManager.GetSystemAreaGuid(portalContext, SystemArea.Keyword);
Area keywordArea = AreaManager.GetArea(portalContext, keywordGuid);
keywordArea.AddKeyword("String1");

Following is an example that does not acquire the keyword instance.

TopologyManager topologyManager = new TopologyManager();
Uri uri = new Uri("http://MyPortal");
PortalSiteCollection sites = topologyManager.PortalSites;
PortalContext portalContext = PortalApplication.GetContext(sites[uri]);
Guid homeGuid = AreaManager.GetSystemAreaGuid(portalContext, SystemArea.Home);
Area homeArea = AreaManager.GetArea(portalContext, homeGuid);
AreaCollection subareas = homeArea.Areas;
Area keywordArea = subareas["Keywords"];
keywordArea.AddKeyword("String1");

继承层次结构

System.Object
  Microsoft.SharePoint.Portal.SiteData.AreaManager

线程安全性

此类型的任何公共静态( Visual Basic 中共享)成员是线程安全的。不保证任何实例成员都是线程安全的。

另请参阅

参考

AreaManager 成员
Microsoft.SharePoint.Portal.SiteData 命名空间