ClearScript Library
ClearScript Library
ClearScript Library Reference
Microsoft.ClearScript
IPropertyBag Interface
IPropertyBag Properties
IPropertyBag Methods

# IPropertyBag Interface

Represents a scriptable collection of named properties.
Namespace: Microsoft.ClearScript
Assembly: ClearScript.Core (in ClearScript.Core.dll) Version: 7.5.0
Syntax
C#
VB
C++
F#
Copy

    public interface IPropertyBag : IDictionary<string, Object>,
    	ICollection<KeyValuePair<string, Object>>, IEnumerable<KeyValuePair<string, Object>>,
    	IEnumerable

    Public Interface IPropertyBag
    	Inherits IDictionary(Of String, Object), ICollection(Of KeyValuePair(Of String, Object)),
    	IEnumerable(Of KeyValuePair(Of String, Object)), IEnumerable

    public interface class IPropertyBag : IDictionary<String^, Object^>,
    	ICollection<KeyValuePair<String^, Object^>>, IEnumerable<KeyValuePair<String^, Object^>>,
    	IEnumerable

    type IPropertyBag =
        interface
            interface IDictionary<string, Object>
            interface ICollection<KeyValuePair<string, Object>>
            interface IEnumerable<KeyValuePair<string, Object>>
            interface IEnumerable
        end

The IPropertyBag type exposes the following members.

Properties

| Name | Description
--- | --- | ---
| Count | Gets the number of elements contained in the ICollectionT. (Inherited from ICollection KeyValuePair String, Object)
| IsReadOnly | Gets a value indicating whether the ICollectionT is read-only. (Inherited from ICollection KeyValuePair String, Object)
| Item | Gets or sets the element with the specified key. (Inherited from IDictionary String, Object)
| Keys | Gets an ICollectionT containing the keys of the IDictionaryTKey, TValue. (Inherited from IDictionary String, Object)
| Values | Gets an ICollectionT containing the values in the IDictionaryTKey, TValue. (Inherited from IDictionary String, Object)

Top
Methods

| Name | Description
--- | --- | ---
| Add(T) | Adds an item to the ICollectionT. (Inherited from ICollection KeyValuePair String, Object)
| Add(TKey, TValue) | Adds an element with the provided key and value to the IDictionaryTKey, TValue. (Inherited from IDictionary String, Object)
| Clear | Removes all items from the ICollectionT. (Inherited from ICollection KeyValuePair String, Object)
| Contains | Determines whether the ICollectionT contains a specific value. (Inherited from ICollection KeyValuePair String, Object)
| ContainsKey | Determines whether the IDictionaryTKey, TValue contains an element with the specified key. (Inherited from IDictionary String, Object)
| CopyTo | Copies the elements of the ICollectionT to an Array, starting at a particular Array index. (Inherited from ICollection KeyValuePair String, Object)
| GetEnumerator | Returns an enumerator that iterates through the collection. (Inherited from IEnumerable KeyValuePair String, Object)
| Remove(T) | Removes the first occurrence of a specific object from the ICollectionT. (Inherited from ICollection KeyValuePair String, Object)
| Remove(TKey) | Removes the element with the specified key from the IDictionaryTKey, TValue. (Inherited from IDictionary String, Object)
| TryGetValue | Gets the value associated with the specified key. (Inherited from IDictionary String, Object)

Top
Remarks
If an object that implements this interface is added to a script engine (see AddHostObject), script code will be able to access the properties stored in the collection as if they were members of the object itself, using the script language's native syntax for member access. No other members of the object will be accessible. This interface also allows objects to implement dynamic properties for script languages that support them.
See Also

#### Reference

Microsoft.ClearScript Namespace

Copyright © Microsoft Corporation. All rights reserved.

Send comments on this topic to Microsoft