Class StatusControlCollection
[Obfuscation(Exclude = true, ApplyToMembers = true)]
[Serializable]
public class StatusControlCollection
Inheritance
Inherited Members
Namespace: HomeSeer.PluginSdk.Devices.Controls
Assembly: PluginSdk.dll
A managed collection of StatusControls
Remarks
This is a System.Collections.Generic.SortedDictionary<TKey, TValue> where TargetValue or Min of TargetRange is used as the key. This is used to ensure that there is only one StatusControl per Value
Fields
View Source_statusControls
Declaration
SortedDictionary<double, StatusControl> _statusControls
Field Value
| Type | Description |
|---|---|
| System.Collections.Generic.SortedDictionary<System.Double, StatusControl> |
Properties
View SourceCount
The number of StatusControls in the collection
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Item[Double]
Get the StatusControl in the collection that handles the specified value
Declaration
public StatusControl this[double value] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | value | The value associated with the desired StatusControl |
Property Value
| Type | Description |
|---|---|
| StatusControl |
Exceptions
| Type | Condition |
|---|---|
| System.Collections.Generic.KeyNotFoundException | Thrown when no StatusControl is found that handles the specified |
Values
Get an unordered list of the StatusControls in the collection
Declaration
public List<StatusControl> Values { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<StatusControl> |
Methods
View SourceAdd(StatusControl)
Add a StatusControl to the collection
Declaration
public void Add(StatusControl statusControl)
Parameters
| Type | Name | Description |
|---|---|---|
| StatusControl | statusControl | A StatusControl to add. It must not target a value that is already handled by the collection. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown if the |
AddRange(List<StatusControl>)
Add multiple StatusControls to the collection
Declaration
public void AddRange(List<StatusControl> statusControls)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.List<StatusControl> | statusControls | A collection of StatusControls to add. Make sure there is only one StatusControl handling each value. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown if any element in |
Contains(StatusControl)
Determine if a StatusControl is already in the managed collection
Declaration
public bool Contains(StatusControl statusControl)
Parameters
| Type | Name | Description |
|---|---|---|
| StatusControl | statusControl | The StatusControl to search for |
Returns
| Type | Description |
|---|---|
| System.Boolean | langword_csharp_True if the |
Remarks
This check is based on TargetValue or the Min of TargetRange
ContainsValue(Double)
Determine if a value is handled by the collection
Declaration
public bool ContainsValue(double value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | value | The value to check for |
Returns
| Type | Description |
|---|---|
| System.Boolean | langword_csharp_True if the value is handled, langword_csharp_False if it is not |
GetControlsForRange(Double, Double)
Get a list of StatusControls that handle a given range of values
Declaration
public List<StatusControl> GetControlsForRange(double min, double max)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | min | The smallest number in the range |
| System.Double | max | The largest number in the range |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<StatusControl> | A List of StatusControls |
GetControlsForUse(EControlUse)
Get all StatusControls in the collection which have a specific EControlUse
Declaration
public List<StatusControl> GetControlsForUse(EControlUse controlUse)
Parameters
| Type | Name | Description |
|---|---|---|
| EControlUse | controlUse | The EControlUse value to look for |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<StatusControl> | A List of StatusControls found that have the specified |
Remarks
If no StatusControls are found with the specified controlUse,
an empty List is returned.
GetFirstControlForUse(EControlUse)
Get a StatusControl in the collection which has a specific EControlUse
Declaration
public StatusControl GetFirstControlForUse(EControlUse controlUse)
Parameters
| Type | Name | Description |
|---|---|---|
| EControlUse | controlUse | The EControlUse value to look for |
Returns
| Type | Description |
|---|---|
| StatusControl | The first StatusControl found that has the specified |
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | Thrown if no element is found with the specified |
HasControlForUse(EControlUse)
Determine if the collection contains a StatusControl with a specific EControlUse
Declaration
public bool HasControlForUse(EControlUse controlUse)
Parameters
| Type | Name | Description |
|---|---|---|
| EControlUse | controlUse | The EControlUse value to look for |
Returns
| Type | Description |
|---|---|
| System.Boolean | TRUE if the collection contains such a StatusControl, FALSE if it does not |
Remove(StatusControl)
Remove a StatusControl from the collection
Declaration
public void Remove(StatusControl statusControl)
Parameters
| Type | Name | Description |
|---|---|---|
| StatusControl | statusControl | A StatusControl to remove |
Remarks
A key is determined by the TargetValue or the Min of
TargetRange of statusControl.
The found item is then compared by hash code to ensure they are the
same.
RemoveAll()
Remove all StatusControls in the collection
Declaration
public void RemoveAll()
RemoveKey(Double)
Remove the StatusControl that handles the specified value
Declaration
public void RemoveKey(double value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | value | The value handled by the StatusControl to remove |