Class SsdpDevicePropertiesCollection
Represents a collection of SsdpDeviceProperty instances keyed by the FullName property value.
Inheritance
Implements
Inherited Members
Namespace: Rssdp
Assembly: cs.temp.dll.dll
Syntax
public class SsdpDevicePropertiesCollection : IEnumerable<SsdpDeviceProperty>, IEnumerable
Remarks
Items added to this collection are keyed by their FullName property value, at the time they were added. If the name changes after they were added to the collection, the key is not updated unless the item is manually removed and re-added to the collection.
Constructors
SsdpDevicePropertiesCollection()
Default constructor.
Declaration
public SsdpDevicePropertiesCollection()
SsdpDevicePropertiesCollection(Int32)
Full constructor.
Declaration
public SsdpDevicePropertiesCollection(int capacity)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | capacity | Specifies the initial capacity of the collection. |
Properties
Count
Returns the number of items in the collection.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Item[String]
Returns the SsdpDeviceProperty instance from the collection that has the specified FullName value.
Declaration
public SsdpDeviceProperty this[string fullName] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | fullName | The full name of the property to return. |
Property Value
| Type | Description |
|---|---|
| SsdpDeviceProperty | A SsdpDeviceProperty instance from the collection. |
Exceptions
| Type | Condition |
|---|---|
| System.Collections.Generic.KeyNotFoundException | Thrown if no item exists in the collection with the specified |
Methods
Add(SsdpDeviceProperty)
Adds a SsdpDeviceProperty instance to the collection.
Declaration
public void Add(SsdpDeviceProperty customDeviceProperty)
Parameters
| Type | Name | Description |
|---|---|---|
| SsdpDeviceProperty | customDeviceProperty | The property instance to add to the collection. |
Remarks
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if |
| System.ArgumentException | Thrown if the FullName property of the |
Contains(SsdpDeviceProperty)
Returns a boolean indicating whether or not the specified SsdpDeviceProperty instance is in the collection.
Declaration
public bool Contains(SsdpDeviceProperty customDeviceProperty)
Parameters
| Type | Name | Description |
|---|---|---|
| SsdpDeviceProperty | customDeviceProperty | An SsdpDeviceProperty instance to check the collection for. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the specified instance exists in the collection, otherwise false. |
Contains(String)
Returns a boolean indicating whether or not a SsdpDeviceProperty instance with the specified full name value exists in the collection.
Declaration
public bool Contains(string customDevicePropertyFullName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | customDevicePropertyFullName | A string containing the full name of the SsdpDeviceProperty instance to check for. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if an item with the specified full name exists in the collection, otherwise false. |
GetEnumerator()
Returns an enumerator of SsdpDeviceProperty instances in this collection.
Declaration
public IEnumerator<SsdpDeviceProperty> GetEnumerator()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerator<SsdpDeviceProperty> | An enumerator of SsdpDeviceProperty instances in this collection. |
Remove(SsdpDeviceProperty)
Removes the specified property instance from the collection.
Declaration
public bool Remove(SsdpDeviceProperty customDeviceProperty)
Parameters
| Type | Name | Description |
|---|---|---|
| SsdpDeviceProperty | customDeviceProperty | The SsdpDeviceProperty instance to remove from the collection. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if an item was removed from the collection, otherwise false (because it did not exist or was not the same instance). |
Remarks
Only remove the specified property if that instance was in the collection, if another property with the same full name exists in the collection it is not removed.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if the |
| System.ArgumentException | Thrown if the FullName property of the |
See Also
Remove(String)
Removes the property with the specified key (FullName from the collection.
Declaration
public bool Remove(string customDevicePropertyFullName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | customDevicePropertyFullName | The full name of the SsdpDeviceProperty instance to remove from the collection. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if an item was removed from the collection, otherwise false (because no item exists in the collection with that key). |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown if the |
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Returns an enumerator of SsdpDeviceProperty instances in this collection.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
| Type | Description |
|---|---|
| System.Collections.IEnumerator | An enumerator of SsdpDeviceProperty instances in this collection. |