PropertyCollection class

NOTE: This API is now obsolete.

Represents a collection of Property objects.

System.Object
  Microsoft.Office.Server.UserProfiles.PropertyCollection

Namespace:  Microsoft.Office.Server.UserProfiles
Assembly:  Microsoft.Office.Server.UserProfiles (in Microsoft.Office.Server.UserProfiles.dll)

[ObsoleteAttribute("PropertyCollection is replaced by ProfileSubtypePropertyManager.")]
[SharePointPermissionAttribute(SecurityAction.Demand, ObjectModel = true)]
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
public class PropertyCollection : IEnumerable

Use the PropertyCollection class to enumerate all properties defined at a site.

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

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();
}

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