Search Results for

    Show / Hide Table of Contents

    Class StatusControl

    • C#
    • Visual Basic
    [Obfuscation(Exclude = true, ApplyToMembers = true)]
    [Serializable]
    public class StatusControl
    <Obfuscation(Exclude:=True, ApplyToMembers:=True)>
    <Serializable>
    Public Class StatusControl
    Inheritance
    System.Object
    StatusControl
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: HomeSeer.PluginSdk.Devices.Controls
    Assembly: PluginSdk.dll


    A control associated with a feature on a HomeSeer system. Formerly referred to as a VSPair.

    This defines a control that will be available for a user to interact with.


    Remarks

    Legacy VSPairs used to be able to be defined as either status-only, control-only, or both, but this is no longer allowed. All StatusControls are considered both, and a StatusGraphic will override the DisplayedStatus on the feature if it is configured for the feature's current Value.

    If you are looking to add a status-only control to a feature, create a StatusGraphic instead.

    Constructors

    View Source

    StatusControl(EControlType)

    Initialize a new StatusControl of the specified type

    Declaration
    • C#
    • Visual Basic
    public StatusControl(EControlType type)
    Public Sub New(type As EControlType)
    Parameters
    Type Name Description
    EControlType type

    The EControlType of the control

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    Thrown if an invalid type is specified

    Fields

    View Source

    _controlStates

    Declaration
    • C#
    • Visual Basic
    List<string> _controlStates
    _controlStates As List(Of String)
    Field Value
    Type Description
    System.Collections.Generic.List<System.String>
    View Source

    _controlType

    Declaration
    • C#
    • Visual Basic
    EControlType _controlType
    _controlType As EControlType
    Field Value
    Type Description
    EControlType
    View Source

    _controlUse

    Declaration
    • C#
    • Visual Basic
    EControlUse _controlUse
    _controlUse As EControlUse
    Field Value
    Type Description
    EControlUse
    View Source

    _flags

    Declaration
    • C#
    • Visual Basic
    uint _flags
    _flags As UInteger
    Field Value
    Type Description
    System.UInt32
    View Source

    _isRange

    Declaration
    • C#
    • Visual Basic
    bool _isRange
    _isRange As Boolean
    Field Value
    Type Description
    System.Boolean
    View Source

    _label

    Declaration
    • C#
    • Visual Basic
    string _label
    _label As String
    Field Value
    Type Description
    System.String
    View Source

    _location

    Declaration
    • C#
    • Visual Basic
    ControlLocation _location
    _location As ControlLocation
    Field Value
    Type Description
    ControlLocation
    View Source

    _targetRange

    Declaration
    • C#
    • Visual Basic
    ValueRange _targetRange
    _targetRange As ValueRange
    Field Value
    Type Description
    ValueRange
    View Source

    _targetValue

    Declaration
    • C#
    • Visual Basic
    double _targetValue
    _targetValue As Double
    Field Value
    Type Description
    System.Double

    Properties

    View Source

    Column

    The column that the StatusControl is located at

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

    ControlStates

    The possible states available for users to set this control to.

    This is only used when the ControlType is set to TextSelectList

    Declaration
    • C#
    • Visual Basic
    public List<string> ControlStates { get; set; }
    Public Property ControlStates As List(Of String)
    Property Value
    Type Description
    System.Collections.Generic.List<System.String>
    View Source

    ControlType

    The style the control is displayed as to users

    Declaration
    • C#
    • Visual Basic
    public EControlType ControlType { get; set; }
    Public Property ControlType As EControlType
    Property Value
    Type Description
    EControlType
    See Also
    EControlType
    View Source

    ControlUse

    What the StatusControl is used for. See EControlUse for more information.

    Declaration
    • C#
    • Visual Basic
    public EControlUse ControlUse { get; set; }
    Public Property ControlUse As EControlUse
    Property Value
    Type Description
    EControlUse
    See Also
    EControlUse
    View Source

    HasAdditionalData

    Whether the StatusControl label includes additional data tokens to be replaced by strings in AdditionalStatusData

    Declaration
    • C#
    • Visual Basic
    public bool HasAdditionalData { get; set; }
    Public Property HasAdditionalData As Boolean
    Property Value
    Type Description
    System.Boolean
    View Source

    IsInvalidStatusTarget

    Whether the StatusControl should be available as a status target for events and other platform integrations

    Declaration
    • C#
    • Visual Basic
    public bool IsInvalidStatusTarget { get; set; }
    Public Property IsInvalidStatusTarget As Boolean
    Property Value
    Type Description
    System.Boolean

    FALSE if the StatusControl is a valid status target, TRUE if it is not.

    See Also
    InvalidStatusTarget
    View Source

    IsRange

    Whether the StatusControl targets a range of values or a single value.

    Settings this to TRUE will cause the TargetValue field to be ignored in favor of the TargetRange

    Declaration
    • C#
    • Visual Basic
    public bool IsRange { get; set; }
    Public Property IsRange As Boolean
    Property Value
    Type Description
    System.Boolean
    View Source

    Label

    The text displayed on the control.

    Unless overridden by a Label associated with the same feature, this text is used as the status for the corresponding value.

    Declaration
    • C#
    • Visual Basic
    public string Label { get; set; }
    Public Property Label As String
    Property Value
    Type Description
    System.String
    View Source

    Location

    The location of the StatusControl when displayed to users

    Declaration
    • C#
    • Visual Basic
    public ControlLocation Location { get; set; }
    Public Property Location As ControlLocation
    Property Value
    Type Description
    ControlLocation
    See Also
    ControlLocation
    View Source

    Row

    The row that the StatusControl is located at

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

    TargetRange

    The range of values that the StatusControl targets.

    If IsRange is FALSE then this is ignored in favor of TargetValue

    Declaration
    • C#
    • Visual Basic
    public ValueRange TargetRange { get; set; }
    Public Property TargetRange As ValueRange
    Property Value
    Type Description
    ValueRange
    See Also
    ValueRange
    View Source

    TargetValue

    The value this StatusControl targets.

    If IsRange is TRUE then this is ignored in favor of TargetRange

    Declaration
    • C#
    • Visual Basic
    public double TargetValue { get; set; }
    Public Property TargetValue As Double
    Property Value
    Type Description
    System.Double
    View Source

    Width

    The number of columns the StatusControl occupies

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

    Methods

    View Source

    AddFlag(EControlFlag)

    Add the specified EControlFlag to the StatusControl

    Declaration
    • C#
    • Visual Basic
    void AddFlag(EControlFlag controlFlag)
    Sub AddFlag(controlFlag As EControlFlag)
    Parameters
    Type Name Description
    EControlFlag controlFlag

    The EControlFlag to add

    View Source

    ClearFlags()

    Clear all EControlFlags on the StatusControl.

    Declaration
    • C#
    • Visual Basic
    void ClearFlags()
    Sub ClearFlags
    View Source

    ContainsFlag(EControlFlag)

    Determine if the StatusControl contains the specified EControlFlag

    Declaration
    • C#
    • Visual Basic
    bool ContainsFlag(EControlFlag controlFlag)
    Function ContainsFlag(controlFlag As EControlFlag) As Boolean
    Parameters
    Type Name Description
    EControlFlag controlFlag

    The EControlFlag to look for

    Returns
    Type Description
    System.Boolean

    TRUE if the StatusControl contains the EControlFlag, FALSE if it does not.

    View Source

    CreateControlEvent(Int32)

    Create a ControlEvent from this StatusControl for a given devRef. This uses the TargetValue for the ControlValue

    Declaration
    • C#
    • Visual Basic
    public ControlEvent CreateControlEvent(int devRef)
    Public Function CreateControlEvent(devRef As Integer) As ControlEvent
    Parameters
    Type Name Description
    System.Int32 devRef

    The Ref of the HsFeature being controlled.

    Returns
    Type Description
    ControlEvent

    A ControlEvent

    View Source

    CreateControlEvent(Int32, Double)

    Create a ControlEvent from this StatusControl for a given value and devRef.

    Declaration
    • C#
    • Visual Basic
    public ControlEvent CreateControlEvent(int devRef, double value)
    Public Function CreateControlEvent(devRef As Integer, value As Double) As ControlEvent
    Parameters
    Type Name Description
    System.Int32 devRef

    The Ref of the HsFeature being controlled.

    System.Double value

    The target Value for the HsFeature

    Returns
    Type Description
    ControlEvent

    A ControlEvent

    Remarks

    Use this when the StatusControl is a range and a specific value must by chosen within that range.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    Thrown when the value is not targeted by the StatusControl

    View Source

    Equals(Object)

    Compare this object with another to see if they are equal

    Declaration
    • C#
    • Visual Basic
    public override bool Equals(object obj)
    Public Overrides Function Equals(obj As Object) As Boolean
    Parameters
    Type Name Description
    System.Object obj

    The object to compare

    Returns
    Type Description
    System.Boolean

    true if they are equal, false if they are not

    Overrides
    System.Object.Equals(System.Object)
    View Source

    GetHashCode()

    Get the hash code

    Declaration
    • C#
    • Visual Basic
    public override int GetHashCode()
    Public Overrides Function GetHashCode As Integer
    Returns
    Type Description
    System.Int32

    A hash code based on the Min of TargetRange if IsRange is true or TargetValue if it is false.

    Overrides
    System.Object.GetHashCode()
    View Source

    GetLabelForValue(Double, String[])

    Get the label for the specified value correctly formatted according to the StatusControl's configuration

    Declaration
    • C#
    • Visual Basic
    public string GetLabelForValue(double value, string[] additionalData = null)
    Public Function GetLabelForValue(value As Double, additionalData As String() = Nothing) As String
    Parameters
    Type Name Description
    System.Double value

    The value to get the label for

    System.String[] additionalData

    Additional data to include in the status label that replaces any tokens from GetAdditionalDataToken(Int32) included in the status.

    Returns
    Type Description
    System.String

    The value as a string formatted according to the TargetRange configuration.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    Thrown when the value is not targeted by the StatusControl

    View Source

    IsValueInRange(Double)

    Determine if a specified value is targeted by the StatusControl"/>

    Declaration
    • C#
    • Visual Basic
    public bool IsValueInRange(double value)
    Public Function IsValueInRange(value As Double) As Boolean
    Parameters
    Type Name Description
    System.Double value

    The value to check

    Returns
    Type Description
    System.Boolean

    TRUE if the value is targeted by the StatusControl, FALSE if it is not

    View Source

    RemoveFlag(EControlFlag)

    Remove the specified EControlFlag from the StatusControl

    Declaration
    • C#
    • Visual Basic
    void RemoveFlag(EControlFlag controlFlag)
    Sub RemoveFlag(controlFlag As EControlFlag)
    Parameters
    Type Name Description
    EControlFlag controlFlag

    The EControlFlag to remove

    View Source

    ReplaceAdditionalData(String, String[])

    Declaration
    • C#
    • Visual Basic
    string ReplaceAdditionalData(string label, string[] additionalData)
    Function ReplaceAdditionalData(label As String, additionalData As String()) As String
    Parameters
    Type Name Description
    System.String label
    System.String[] additionalData
    Returns
    Type Description
    System.String
    View Source

    TryGetLabelForValue(out String, Double, String[])

    Try to get the label for the specified value correctly formatted according to the StatusControl's configuration.

    Declaration
    • C#
    • Visual Basic
    public bool TryGetLabelForValue(out string label, double value, string[] additionalData = null)
    Public Function TryGetLabelForValue(ByRef label As String, value As Double, additionalData As String() = Nothing) As Boolean
    Parameters
    Type Name Description
    System.String label

    The string variable the label will be written to

    System.Double value

    The value to get the label for

    System.String[] additionalData

    Additional data to include in the status label that replaces any tokens from GetAdditionalDataToken(Int32) included in the status.

    Returns
    Type Description
    System.Boolean

    TRUE if a label is available for the StatusControl, FALSE if the value is not valid for this StatusControl or there is no label defined.

    See Also

    StatusGraphic
    • View Source
    In This Article
    Back to top HomeSeer Technologies