Partager via


PropertyCollection Class

Allows property owners to control the lifetimes of the properties in the collection.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Utilities.PropertyCollection

Namespace:  Microsoft.VisualStudio.Utilities
Assembly:  Microsoft.VisualStudio.CoreUtility (in Microsoft.VisualStudio.CoreUtility.dll)

Syntax

'Déclaration
Public Class PropertyCollection
public class PropertyCollection
public ref class PropertyCollection
type PropertyCollection =  class end
public class PropertyCollection

The PropertyCollection type exposes the following members.

Constructors

  Name Description
Public method PropertyCollection Initializes a new instance of PropertyCollection.

Top

Properties

  Name Description
Public property Item Gets or sets the Object with the specified key.
Public property PropertyList Returns the property collection as a read-only collection.

Top

Methods

  Name Description
Public method AddProperty Adds a new property to the collection.
Public method ContainsProperty Determines whether the property collection contains a property for the specified key.
Public method Equals Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetOrCreateSingletonProperty<T>(Func<TResult>) Gets or creates a property of type T from the property collection.
Public method GetOrCreateSingletonProperty<T>(Object, Func<TResult>) Gets or creates a property of type T from the property collection.
Public method GetProperty(Object) Gets the property associated with the specified key.
Public method GetProperty<TProperty>(Object) Gets the property associated with the specified key.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method RemoveProperty Removes the property associated with the specified key.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method TryGetProperty<TProperty> Gets the property associated with the specified key.

Top

Remarks

This collection is synchronized in order to allow access by multiple threads.

Thread Safety

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

See Also

Reference

Microsoft.VisualStudio.Utilities Namespace