Class StatusGraphicCollection
[Obfuscation(Exclude = true, ApplyToMembers = true)]
[Serializable]
public class StatusGraphicCollection
Inheritance
Inherited Members
Namespace: HomeSeer.PluginSdk.Devices
Assembly: PluginSdk.dll
A managed collection of StatusGraphics
Remarks
This is a System.Collections.Generic.SortedDictionary<TKey, TValue> where Value or RangeMin is used as the key. This is used to ensure that there is only one StatusGraphic per Value
Fields
View Source_statusGraphics
Declaration
SortedDictionary<double, StatusGraphic> _statusGraphics
Field Value
Type | Description |
---|---|
System.Collections.Generic.SortedDictionary<System.Double, StatusGraphic> |
Properties
View SourceCount
The number of StatusGraphics in the collection
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Item[Double]
Get the StatusGraphic in the collection that handles the specified value
Declaration
public StatusGraphic this[double value] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value associated with the desired StatusGraphic |
Property Value
Type | Description |
---|---|
StatusGraphic |
Exceptions
Type | Condition |
---|---|
System.Collections.Generic.KeyNotFoundException | Thrown when no StatusGraphic is found that handles the specified |
Values
Get an unordered list of the StatusGraphics in the collection
Declaration
public List<StatusGraphic> Values { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<StatusGraphic> |
Methods
View SourceAdd(StatusGraphic)
Add a StatusGraphic to the collection
Declaration
public void Add(StatusGraphic statusGraphic)
Parameters
Type | Name | Description |
---|---|---|
StatusGraphic | statusGraphic | A StatusGraphic to add. It must not target a value that is already handled by the collection. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown if the |
AddRange(IEnumerable<StatusGraphic>)
Add multiple StatusGraphics to the collection
Declaration
public void AddRange(IEnumerable<StatusGraphic> statusGraphics)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<StatusGraphic> | statusGraphics | A collection of StatusGraphics to add. Make sure there is only one StatusGraphic handling each value. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown if any element in |
Contains(StatusGraphic)
Determine if a StatusGraphic is already in the managed collection
Declaration
public bool Contains(StatusGraphic statusGraphic)
Parameters
Type | Name | Description |
---|---|---|
StatusGraphic | statusGraphic | The StatusGraphic to search for |
Returns
Type | Description |
---|---|
System.Boolean | langword_csharp_True if the |
Remarks
View SourceContainsValue(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 |
GetGraphicsForRange(Double, Double)
Get a list of StatusGraphics that handle a given range of values
Declaration
public List<StatusGraphic> GetGraphicsForRange(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<StatusGraphic> | A List of StatusGraphics |
Remove(StatusGraphic)
Remove a StatusGraphic from the collection
Declaration
public void Remove(StatusGraphic statusGraphic)
Parameters
Type | Name | Description |
---|---|---|
StatusGraphic | statusGraphic | A StatusGraphic to remove |
Remarks
A key is determined by the Value or RangeMin
of statusGraphic
. The found item is then compared by hash code to ensure they are the
same.
RemoveAll()
Remove all StatusGraphics in the collection
Declaration
public void RemoveAll()
RemoveKey(Double)
Remove the StatusGraphic that handles the specified value
Declaration
public void RemoveKey(double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value handled by the StatusGraphic to remove |