Search Results for

    Show / Hide Table of Contents

    Class ToggleView

    • C#
    • Visual Basic
    public sealed class ToggleView : AbstractView
    Public NotInheritable Class ToggleView
        Inherits AbstractView
    Inheritance
    System.Object
    AbstractView
    ToggleView
    Inherited Members
    AbstractView.Id
    AbstractView.Name
    AbstractView.Type
    AbstractView.HtmlIndent
    AbstractView.NonAllowedCharactersForId
    AbstractView.GetIndentStringFromNumber(Int32)
    AbstractView.IdContainsNonAllowedCharacters()
    AbstractView.ShallowCopy()
    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.Jui.Views
    Assembly: PluginSdk.dll


    A toggle switch is used to indicate a control that has only two possible operational states.


    Constructors

    View Source

    ToggleView(String, String, Boolean)

    Create a new instance of a toggle with an ID and Name

    Declaration
    • C#
    • Visual Basic
    [JsonConstructor]
    public ToggleView(string id, string name, bool isEnabled = false)
    <JsonConstructor>
    Public Sub New(id As String, name As String, isEnabled As Boolean = False)
    Parameters
    Type Name Description
    System.String id

    The unique ID for the view

    System.String name

    The name of the view

    System.Boolean isEnabled

    The state of the toggle. DEFAULT: false

    Properties

    View Source

    IsEnabled

    The current state of the toggle switch

    Declaration
    • C#
    • Visual Basic
    [JsonProperty("enabled")]
    public bool IsEnabled { get; set; }
    <JsonProperty("enabled")>
    Public Property IsEnabled As Boolean
    Property Value
    Type Description
    System.Boolean
    View Source

    ToggleType

    The style of toggle

    Declaration
    • C#
    • Visual Basic
    [JsonProperty("toggle_style")]
    public EToggleType ToggleType { get; set; }
    <JsonProperty("toggle_style")>
    Public Property ToggleType As EToggleType
    Property Value
    Type Description
    EToggleType

    Methods

    View Source

    GetStringValue()

    Get the value associated with this view as a string if there is one.

    Declaration
    • C#
    • Visual Basic
    public override string GetStringValue()
    Public Overrides Function GetStringValue As String
    Returns
    Type Description
    System.String

    The value stored in this view as a string or NULL if there is no value stored.

    Overrides
    AbstractView.GetStringValue()
    View Source

    ToHtml(Int32)

    Get a string representation of this view converted into HTML

    Declaration
    • C#
    • Visual Basic
    public override string ToHtml(int indent = 0)
    Public Overrides Function ToHtml(indent As Integer = 0) As String
    Parameters
    Type Name Description
    System.Int32 indent
    Returns
    Type Description
    System.String

    An HTML representation of the view as a string

    Overrides
    AbstractView.ToHtml(Int32)
    View Source

    Update(AbstractView)

    Update the view to the new state. This will change the enabled state

    Declaration
    • C#
    • Visual Basic
    public override void Update(AbstractView newViewState)
    Public Overrides Sub Update(newViewState As AbstractView)
    Parameters
    Type Name Description
    AbstractView newViewState

    The new state of the view being updated. This view's ID and Type must match the calling view exactly

    Overrides
    AbstractView.Update(AbstractView)
    Exceptions
    Type Condition
    ViewTypeMismatchException

    Thrown when the new view's class doesn't match the calling view

    View Source

    UpdateValue(String)

    Update the value of the view

    Declaration
    • C#
    • Visual Basic
    public override void UpdateValue(string value)
    Public Overrides Sub UpdateValue(value As String)
    Parameters
    Type Name Description
    System.String value

    The new value

    Overrides
    AbstractView.UpdateValue(String)
    Exceptions
    Type Condition
    System.FormatException

    Thrown when the value is not in the correct format

    • View Source
    In This Article
    Back to top HomeSeer Technologies