Clase PropertyCollection
NOTA: esta API está ahora obsoleta.
Representa una colección de objetos Property .
Jerarquía de la herencia
System.Object
Microsoft.Office.Server.UserProfiles.PropertyCollection
Espacio de nombres: Microsoft.Office.Server.UserProfiles
Ensamblado: Microsoft.Office.Server.UserProfiles (en Microsoft.Office.Server.UserProfiles.dll)
Sintaxis
'Declaración
<ObsoleteAttribute("PropertyCollection is replaced by ProfileSubtypePropertyManager.")> _
<SharePointPermissionAttribute(SecurityAction.Demand, ObjectModel := True)> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel := True)> _
Public Class PropertyCollection _
Implements IEnumerable
'Uso
Dim instance As PropertyCollection
[ObsoleteAttribute("PropertyCollection is replaced by ProfileSubtypePropertyManager.")]
[SharePointPermissionAttribute(SecurityAction.Demand, ObjectModel = true)]
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
public class PropertyCollection : IEnumerable
Comentarios
Utilice la clase PropertyCollection para enumerar todas las propiedades definidas en un sitio.
Ejemplos
En el ejemplo de código siguiente se muestra el uso de la clase 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();
}
Seguridad para subprocesos
Los miembros static (Shared en Visual Basic) públicos de este tipo son seguros para subprocesos. No se garantiza que los miembros de instancias sean seguros para los subprocesos.