SalNamedProperties
Namespace: PPJ.Runtime.Windows
Assembly: PPJ.Runtime.50 (5.0.0.0)
Stores string-valued properties under case-insensitive names for SAL controls.
- C#
- VB.NET
public class SalNamedProperties : IList, ICollection, IEnumerable, IDictionary
Public Class SalNamedProperties
Inherits IList
Implements ICollection, IEnumerable, IDictionary
The collection uses a hash table and does not guarantee enumeration order. Use the string indexer or Put to replace an existing value; Add rejects duplicate names. The IList interface does not support positional access, insertion, or removal.
Example:
var properties = new PPJ.Runtime.Windows.SalNamedProperties();
properties.Add("CustomerId", "42");
string id = properties["customerid"]; // "42"
properties.Put("CustomerId", "43");
bool exists = properties.Contains("CUSTOMERID"); // true
Constructors
SalNamedProperties()
Initializes a new instance of SalNamedProperties.
Properties
Count
Int32: Gets the number of named properties in the collection.
Item(key)
String: Gets or sets a property value using a case-insensitive name lookup.
Keys
ICollection: Gets a collection view of the stored property names.
Values
ICollection: Gets a collection view of the stored property values.
Methods
Add(key, value)
Adds a property whose name is not already present.
| Parameter | Type | Description |
|---|---|---|
| key | String | The non-null property name. |
| value | String | The property value, which may be null. |
Throws:
- ArgumentNullException key is null.
- ArgumentException The collection already contains the name, ignoring case.
Clear()
Removes every named property from the collection.
Contains(key)
Checks whether a property name exists, ignoring case.
| Parameter | Type | Description |
|---|---|---|
| key | String | The non-null property name to find. |
Returns: Boolean. when the name is present, including when its value is null; otherwise, .
CopyTo(array, index)
Copies the collection's key/value entries to an array.
| Parameter | Type | Description |
|---|---|---|
| array | Array | A one-dimensional destination array compatible with DictionaryEntry values. |
| index | Int32 | The zero-based destination index at which copying begins. |
GetEnumerator()
Gets an enumerator over the named properties.
Returns: IEnumerator. An enumerator whose current value is a DictionaryEntry containing a property name and value.
Put(key, value)
Adds a named property or replaces its existing value using a case-insensitive name lookup.
| Parameter | Type | Description |
|---|---|---|
| key | String | The non-null property name. |
| value | String | The property value, which may be null. |
Throws:
- ArgumentNullException key is null.
Remove(key)
Removes the property with the specified name, if present.
| Parameter | Type | Description |
|---|---|---|
| key | String | The property name to remove, compared without regard to case. |