ClearScript Library
ClearScript Library
ClearScript Library Reference
Microsoft.ClearScript
PropertyBag Class
PropertyBag Constructor
PropertyBag Properties
PropertyBag Methods
PropertyBag Events

# PropertyBag Class

Provides a default IPropertyBag implementation.
Inheritance Hierarchy
SystemObject
Microsoft.ClearScriptPropertyBag
Microsoft.ClearScriptConcurrentPropertyBag
Microsoft.ClearScriptHostTypeCollection
Namespace: Microsoft.ClearScript
Assembly: ClearScript.Core (in ClearScript.Core.dll) Version: 7.5.0
Syntax
C#
VB
C++
F#
Copy

    public class PropertyBag : IPropertyBag,
    	IDictionary<string, Object>, ICollection<KeyValuePair<string, Object>>,
    	IEnumerable<KeyValuePair<string, Object>>, IEnumerable,
    	INotifyPropertyChanged, IScriptableObject

    Public Class PropertyBag
    	Implements IPropertyBag, IDictionary(Of String, Object),
    	ICollection(Of KeyValuePair(Of String, Object)), IEnumerable(Of KeyValuePair(Of String, Object)),
    	IEnumerable, INotifyPropertyChanged, IScriptableObject

    public ref class PropertyBag : IPropertyBag,
    	IDictionary<String^, Object^>, ICollection<KeyValuePair<String^, Object^>>,
    	IEnumerable<KeyValuePair<String^, Object^>>, IEnumerable,
    	INotifyPropertyChanged, IScriptableObject

    type PropertyBag =
        class
            interface IPropertyBag
            interface IDictionary<string, Object>
            interface ICollection<KeyValuePair<string, Object>>
            interface IEnumerable<KeyValuePair<string, Object>>
            interface IEnumerable
            interface INotifyPropertyChanged
            interface IScriptableObject
        end

The PropertyBag type exposes the following members.

Constructors

| Name | Description
--- | --- | ---
| PropertyBag | Initializes a new writable PropertyBag with the default property name comparer.
| PropertyBag(Boolean) | Initializes a new PropertyBag with the default property name comparer.
| PropertyBag(IEqualityComparerString) | Initializes a new writable PropertyBag.
| PropertyBag(Boolean, IEqualityComparerString) | Initializes a new PropertyBag.

Top
Properties

| Name | Description
--- | --- | ---
| Comparer | Gets the property name comparer for the PropertyBag.
| Item | Gets or sets a property value in the PropertyBag.
| Keys | Gets a collection of property names from the PropertyBag.
| Values | Gets a collection of property values from the PropertyBag.

Top
Methods

| Name | Description
--- | --- | ---
| Add | Adds a property to the PropertyBag.
| ClearNoCheck | Removes all properties without checking whether the PropertyBag is read-only.
| ContainsKey | Determines whether the PropertyBag contains a property with the specified name.
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object)
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object)
| GetHashCode | Serves as the default hash function. (Inherited from Object)
| GetType | Gets the Type of the current instance. (Inherited from Object)
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object)
| Remove | Removes a property from the PropertyBag.
| RemovePropertyNoCheck | Removes a property without checking whether the PropertyBag is read-only.
| SetPropertyNoCheck | Sets a property value without checking whether the PropertyBag is read-only.
| ToString | Returns a string that represents the current object. (Inherited from Object)
| TryGetValue | Looks up a property value in the PropertyBag.

Top
Events

| Name | Description
--- | --- | ---
| PropertyChanged | Occurs when a property is added or replaced, or when the collection is cleared.

Top
See Also

#### Reference

Microsoft.ClearScript Namespace

Copyright © Microsoft Corporation. All rights reserved.

Send comments on this topic to Microsoft