PropertyCollection Class

The PropertyCollection class represents a collection of Property objects. Use the PropertyCollection class to enumerate all properties defined at a site.

System.Object

   Microsoft.SharePoint.Portal.UserProfiles.PropertyCollection

Public Methods

The following table shows the public methods of the PropertyCollection class and a brief description of each.

Name Description
Add(Microsoft.SharePoint.Portal.UserProfiles.Property) Adds a property to this site
CommitDisplayOrder Commits the changes made to the display order to the user profile database
CopyTo(System.Array, Int32) Copies the elements of the property collection to an array, starting at a specified index
Create(Boolean) Creates a property and specifies whether the property is a section
GetEnumerator Gets the enumerator for the properties
GetPropertyByName(String) Gets a property by name
GetPropertyByURI(String) Gets a property by URI
GetSectionByName(String) Gets a section by name
RemoveByName(String, Boolean) Removes a property from the user profile database by name
RemovePropertyByName(String) Removes the specified property from the user profile database by the property name
RemovePropertyByURI(String) Removes the specified property from the user profile database by the URI of the property
RemoveSectionByName(String) Removes the specified section from the user profile database by name
SetDisplayOrderByName(String, Boolean, Int32) Sets the specified display order of the properties by name
SetDisplayOrderByPropertyName(String, Int32) Sets the specified display order of the properties by property name
SetDisplayOrderByPropertyURI(String, Int32) Sets the specified display order of the properties by property URI
SetDisplayOrderBySectionName(String, Int32) Sets the specified display order of the properties by section name

Public Properties

The following table shows the properties of the PropertyCollection class, the data type of each property, and a brief description of each.

Name Data Type Description
Count Int32 Gets the number of user profile property objects for this collection
IsSynchronized Boolean Gets a value indicating whether access to the property collection is synchronized (thread-safe).
SyncRoot object Gets an object that can be used to synchronize access to this property collection.

Thread Safety

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

Example

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

Requirements

Namespace: Microsoft.SharePoint.Portal.UserProfiles

Platforms: Windows Server 2003

Assembly: Microsoft.SharePoint.Portal (in Microsoft.SharePoint.Portal.dll)

Security: Code Access Security