PropertyCollection - Classe
Remarque : cette API est désormais obsolète.
Représente une collection d'objets de Property .
Hiérarchie d’héritage
System.Object
Microsoft.Office.Server.UserProfiles.PropertyCollection
Espace de noms : Microsoft.Office.Server.UserProfiles
Assembly : Microsoft.Office.Server.UserProfiles (dans Microsoft.Office.Server.UserProfiles.dll)
Syntaxe
'Déclaration
<ObsoleteAttribute("PropertyCollection is replaced by ProfileSubtypePropertyManager.")> _
<SharePointPermissionAttribute(SecurityAction.Demand, ObjectModel := True)> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel := True)> _
Public Class PropertyCollection _
Implements IEnumerable
'Utilisation
Dim instance As PropertyCollection
[ObsoleteAttribute("PropertyCollection is replaced by ProfileSubtypePropertyManager.")]
[SharePointPermissionAttribute(SecurityAction.Demand, ObjectModel = true)]
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
public class PropertyCollection : IEnumerable
Remarques
Utilisez la classe PropertyCollection pour énumérer toutes les propriétés définies sur un site.
Exemples
L'exemple de code suivant illustre l'utilisation de la classe PropertyCollection .
Public Sub SectionSample()
'Get portal site context from topology.
Dim strUrl As String = "http://SampleName"
Dim tm As New TopologyManager()
Dim ps As PortalSite = tm.PortalSites(New Uri(strUrl))
Dim pc As PortalContext = PortalApplication.GetContext(ps)
'Initialize user profile config manager object.
Dim upcm As New UserProfileConfigManager(pc)
'Sample to create a new section.
Dim pcol As PropertyCollection = upcm.GetPropertiesWithSection()
Dim mysection As [Property] = pcol.Create(True)
mysection.Name = "my section"
mysection.Commit()
pcol.SetDisplayOrderBySectionName(mysection.Name, 0)
pcol.CommitDisplayOrder()
End Sub 'SectionSample
public void SectionSample()
{
//Get portal site context from topology.
string strUrl = "http://SampleName";
TopologyManager tm = new TopologyManager();
PortalSite ps = tm.PortalSites[new Uri(strUrl)];
PortalContext pc = PortalApplication.GetContext(ps);
//Initialize user profile config manager object.
UserProfileConfigManager upcm = new UserProfileConfigManager(pc);
//Sample to create a new section.
PropertyCollection pcol = upcm.GetPropertiesWithSection();
Property mysection = pcol.Create(true);
mysection.Name = "my section";
mysection.Commit();
pcol.SetDisplayOrderBySectionName(mysection.Name, 0);
pcol.CommitDisplayOrder();
}
Cohérence de thread
Tous les membres statique (Partagé dans Visual Basic)s publics de ce type sont thread-safe. Cela n’est pas garanti pour les membres d’instance.