Search Results for

    Show / Hide Table of Contents

    Class AbstractView

    • C#
    • Visual Basic
    public abstract class AbstractView
    Public MustInherit Class AbstractView
    Inheritance
    System.Object
    AbstractView
    InputView
    LabelView
    NavigateButtonView
    SelectListView
    TextAreaView
    TimeSpanView
    ToggleView
    ViewGroup
    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.Jui.Views
    Assembly: PluginSdk.dll


    The base implementation of a JUI view


    Constructors

    View Source

    AbstractView(String)

    Create an instance of an AbstractView with an ID

    Declaration
    • C#
    • Visual Basic
    protected AbstractView(string id)
    Protected Sub New(id As String)
    Parameters
    Type Name Description
    System.String id

    The unique ID for the AbstractView

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown if a view is created with an invalid ID

    View Source

    AbstractView(String, String)

    Create an instance of an AbstractView with an ID and Name

    Declaration
    • C#
    • Visual Basic
    protected AbstractView(string id, string name)
    Protected Sub New(id As String, name As String)
    Parameters
    Type Name Description
    System.String id

    The unique ID for the AbstractView

    System.String name

    The name for the AbstractView

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown if a view is created with an invalid ID

    Fields

    View Source

    HtmlIndent

    Represents a tab/indent for formatting HTML

    Declaration
    • C#
    • Visual Basic
    [JsonIgnore]
    const string HtmlIndent = "    "
    <JsonIgnore>
    Const HtmlIndent As String = "    "
    Field Value
    Type Description
    System.String
    View Source

    NonAllowedCharactersForId

    The list of special characters that are not allowed in a view ID

    Declaration
    • C#
    • Visual Basic
    [JsonIgnore]
    static readonly char[] NonAllowedCharactersForId
    <JsonIgnore>
    Shared ReadOnly NonAllowedCharactersForId As Char()
    Field Value
    Type Description
    System.Char[]

    Properties

    View Source

    Id

    A unique identifier for this view. You will need to use this to identify the view when HomeSeer communicates changes to its values from a client.

    Do NOT use any of the following special characters in your view id: !"#$%&'()*+,./:;<=>?@[]^`{|}~ For consistency and readability it is advised to use the format of COMPANY-PLUGIN-PAGE-VIEW

    For example: a LabelView on the first settings page in the Z-Wave Plugin might have an id of HomeSeer-ZWave-Settings1-InterfaceName

    Declaration
    • C#
    • Visual Basic
    [JsonProperty("id", Required = Required.Always)]
    public string Id { get; protected set; }
    <JsonProperty("id", Required:=Required.Always)>
    Public Property Id As String
    Property Value
    Type Description
    System.String
    View Source

    Name

    The name/title of this view

    Declaration
    • C#
    • Visual Basic
    [JsonProperty("name")]
    public string Name { get; protected set; }
    <JsonProperty("name")>
    Public Property Name As String
    Property Value
    Type Description
    System.String
    View Source

    Type

    The type of this view.

    This is automatically configured

    Declaration
    • C#
    • Visual Basic
    [JsonProperty("type", Required = Required.Always)]
    public EViewType Type { get; protected set; }
    <JsonProperty("type", Required:=Required.Always)>
    Public Property Type As EViewType
    Property Value
    Type Description
    EViewType

    Methods

    View Source

    GetIndentStringFromNumber(Int32)

    Used to generate the exact tab spacing (using spaces) for any given indent amount

    Declaration
    • C#
    • Visual Basic
    public static string GetIndentStringFromNumber(int indent)
    Public Shared Function GetIndentStringFromNumber(indent As Integer) As String
    Parameters
    Type Name Description
    System.Int32 indent

    The number of indents for the line

    Returns
    Type Description
    System.String

    A string containing the number of spaces to achieve the desired indent

    View Source

    GetStringValue()

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

    Declaration
    • C#
    • Visual Basic
    public abstract string GetStringValue()
    Public MustOverride 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.

    View Source

    IdContainsNonAllowedCharacters()

    Used to check if the view ID contains non-allowed characters

    Declaration
    • C#
    • Visual Basic
    public bool IdContainsNonAllowedCharacters()
    Public Function IdContainsNonAllowedCharacters As Boolean
    Returns
    Type Description
    System.Boolean

    True if view ID contains at least one non-allowed characters, False otherwise

    View Source

    ShallowCopy()

    Create a shallow copy of this view

    Declaration
    • C#
    • Visual Basic
    public AbstractView ShallowCopy()
    Public Function ShallowCopy As AbstractView
    Returns
    Type Description
    AbstractView

    The shallow copy of the view

    View Source

    ToHtml(Int32)

    Get a string representation of this view converted into HTML

    Declaration
    • C#
    • Visual Basic
    public abstract string ToHtml(int indent = 0)
    Public MustOverride 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

    View Source

    Update(AbstractView)

    Update the the user editable properties from a new version of the same view

    Declaration
    • C#
    • Visual Basic
    public virtual void Update(AbstractView newViewState)
    Public Overridable 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

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown when the new state of the view is null

    System.InvalidOperationException

    Thrown when the new view's ID or Type don't match the calling view

    View Source

    UpdateValue(String)

    Update the value of the view

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

    The new value

    • View Source
    In This Article
    Back to top HomeSeer Technologies