SalNamedProperties
Namespace: PPJ.Runtime.Windows
Assembly: PPJ.Web.50 (5.0.0.0)
Stores string-valued named properties for SAL controls.
- C#
- VB.NET
public class SalNamedProperties : IList, ICollection, IEnumerable, IDictionary
Public Class SalNamedProperties
Inherits IList
Implements ICollection, IEnumerable, IDictionary
Keys use the underlying hash table's default, case-sensitive comparison. Assign through the indexer or Put to replace an existing value; Add rejects duplicate keys. Enumeration yields dictionary entries, and ordering is not guaranteed.
Example:
var properties = new PPJ.Runtime.Windows.SalNamedProperties();
properties.Add("Caption", "Open");
properties["Caption"] = "Save";
string caption = properties["Caption"]; // "Save"
bool sameKey = properties.Contains("caption"); // false
Constructors
SalNamedProperties()
Initializes a new instance of SalNamedProperties.
Properties
Count
Int32: Gets the number of named properties, including entries with null values.
Item(key)
String: Gets or sets the value associated with a case-sensitive property name.
Keys
ICollection: Gets a collection view of the property names.
Values
ICollection: Gets a collection view of the stored property values.
Methods
Add(key, value)
Adds a new named property without replacing an existing entry.
| Parameter | Type | Description |
|---|---|---|
| key | String | The case-sensitive property name. |
| value | String | The string value to store, including null. |
Throws:
- ArgumentNullException key is null.
- ArgumentException The collection already contains the key.
Clear()
Removes all named properties.
Contains(key)
Tests whether a case-sensitive property name exists.
| Parameter | Type | Description |
|---|---|---|
| key | String | The property name to locate. |
Returns: Boolean. True if the key exists, even when its stored value is null; otherwise, false.
CopyTo(array, index)
Copies the collection's dictionary entries into an array.
| Parameter | Type | Description |
|---|---|---|
| array | Array | The one-dimensional destination array with sufficient capacity. |
| index | Int32 | The zero-based destination index at which copying begins. |
GetEnumerator()
Creates an enumerator over the named-property entries.
Returns: IEnumerator. An enumerator whose current item is a DictionaryEntry.
Put(key, value)
Adds or replaces a named property.
| Parameter | Type | Description |
|---|---|---|
| key | String | The case-sensitive property name. |
| value | String | The string value to store, including null. |
Throws:
- ArgumentNullException key is null.
Remove(key)
Removes the named property if it exists.
| Parameter | Type | Description |
|---|---|---|
| key | String | The case-sensitive property name to remove. |