Search Results for

    Show / Hide Table of Contents

    Class StatusControlCollection

    • C#
    • Visual Basic
    [Obfuscation(Exclude = true, ApplyToMembers = true)]
    [Serializable]
    public class StatusControlCollection
    <Obfuscation(Exclude:=True, ApplyToMembers:=True)>
    <Serializable>
    Public Class StatusControlCollection
    Inheritance
    System.Object
    StatusControlCollection
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    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
    • C#
    • Visual Basic
    SortedDictionary<double, StatusControl> _statusControls
    _statusControls As SortedDictionary(Of Double, StatusControl)
    Field Value
    Type Description
    System.Collections.Generic.SortedDictionary<System.Double, StatusControl>

    Properties

    View Source

    Count

    The number of StatusControls in the collection

    Declaration
    • C#
    • Visual Basic
    public int Count { get; }
    Public ReadOnly Property Count As Integer
    Property Value
    Type Description
    System.Int32
    View Source

    Item[Double]

    Get the StatusControl in the collection that handles the specified value

    Declaration
    • C#
    • Visual Basic
    public StatusControl this[double value] { get; }
    Public ReadOnly Property Item(value As Double) As StatusControl
    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 value

    View Source

    Values

    Get an unordered list of the StatusControls in the collection

    Declaration
    • C#
    • Visual Basic
    public List<StatusControl> Values { get; }
    Public ReadOnly Property Values As List(Of StatusControl)
    Property Value
    Type Description
    System.Collections.Generic.List<StatusControl>

    Methods

    View Source

    Add(StatusControl)

    Add a StatusControl to the collection

    Declaration
    • C#
    • Visual Basic
    public void Add(StatusControl statusControl)
    Public Sub Add(statusControl As 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 statusControl targets a value that is already handled in the collection.

    View Source

    AddRange(List<StatusControl>)

    Add multiple StatusControls to the collection

    Declaration
    • C#
    • Visual Basic
    public void AddRange(List<StatusControl> statusControls)
    Public Sub AddRange(statusControls As List(Of StatusControl))
    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 statusControls targets a value that is already handled in the collection.

    View Source

    Contains(StatusControl)

    Determine if a StatusControl is already in the managed collection

    Declaration
    • C#
    • Visual Basic
    public bool Contains(StatusControl statusControl)
    Public Function Contains(statusControl As StatusControl) As Boolean
    Parameters
    Type Name Description
    StatusControl statusControl

    The StatusControl to search for

    Returns
    Type Description
    System.Boolean

    langword_csharp_True if the statusControl is in the collection, langword_csharp_False if it is not

    Remarks

    This check is based on TargetValue or the Min of TargetRange

    View Source

    ContainsValue(Double)

    Determine if a value is handled by the collection

    Declaration
    • C#
    • Visual Basic
    public bool ContainsValue(double value)
    Public Function ContainsValue(value As Double) As Boolean
    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

    View Source

    GetControlsForRange(Double, Double)

    Get a list of StatusControls that handle a given range of values

    Declaration
    • C#
    • Visual Basic
    public List<StatusControl> GetControlsForRange(double min, double max)
    Public Function GetControlsForRange(min As Double, max As Double) As List(Of StatusControl)
    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

    View Source

    GetControlsForUse(EControlUse)

    Get all StatusControls in the collection which have a specific EControlUse

    Declaration
    • C#
    • Visual Basic
    public List<StatusControl> GetControlsForUse(EControlUse controlUse)
    Public Function GetControlsForUse(controlUse As EControlUse) As List(Of StatusControl)
    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 controlUse.

    Remarks

    If no StatusControls are found with the specified controlUse, an empty List is returned.

    View Source

    GetFirstControlForUse(EControlUse)

    Get a StatusControl in the collection which has a specific EControlUse

    Declaration
    • C#
    • Visual Basic
    public StatusControl GetFirstControlForUse(EControlUse controlUse)
    Public Function GetFirstControlForUse(controlUse As EControlUse) As StatusControl
    Parameters
    Type Name Description
    EControlUse controlUse

    The EControlUse value to look for

    Returns
    Type Description
    StatusControl

    The first StatusControl found that has the specified controlUse.

    Exceptions
    Type Condition
    System.InvalidOperationException

    Thrown if no element is found with the specified controlUse

    View Source

    HasControlForUse(EControlUse)

    Determine if the collection contains a StatusControl with a specific EControlUse

    Declaration
    • C#
    • Visual Basic
    public bool HasControlForUse(EControlUse controlUse)
    Public Function HasControlForUse(controlUse As EControlUse) As Boolean
    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

    View Source

    Remove(StatusControl)

    Remove a StatusControl from the collection

    Declaration
    • C#
    • Visual Basic
    public void Remove(StatusControl statusControl)
    Public Sub Remove(statusControl As 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.

    View Source

    RemoveAll()

    Remove all StatusControls in the collection

    Declaration
    • C#
    • Visual Basic
    public void RemoveAll()
    Public Sub RemoveAll
    View Source

    RemoveKey(Double)

    Remove the StatusControl that handles the specified value

    Declaration
    • C#
    • Visual Basic
    public void RemoveKey(double value)
    Public Sub RemoveKey(value As Double)
    Parameters
    Type Name Description
    System.Double value

    The value handled by the StatusControl to remove

    • View Source
    In This Article
    Back to top HomeSeer Technologies