Search Results for

    Show / Hide Table of Contents

    Class ViewGroup

    • C#
    • Visual Basic
    public class ViewGroup : AbstractView
    Public Class ViewGroup
        Inherits AbstractView
    Inheritance
    System.Object
    AbstractView
    ViewGroup
    GridView
    Inherited Members
    AbstractView.Id
    AbstractView.Name
    AbstractView.Type
    AbstractView.HtmlIndent
    AbstractView.NonAllowedCharactersForId
    AbstractView.UpdateValue(String)
    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


    View groups define a vertical sub-grouping of views with a header.


    Constructors

    View Source

    ViewGroup(String)

    Create a new instance of a view group with an ID

    Declaration
    • C#
    • Visual Basic
    [JsonConstructor]
    protected ViewGroup(string id)
    <JsonConstructor>
    Protected Sub New(id As String)
    Parameters
    Type Name Description
    System.String id

    The unique ID of the group

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown if a view is created with an invalid ID

    View Source

    ViewGroup(String, String)

    Create a new instance of a view group with an ID and Name

    Declaration
    • C#
    • Visual Basic
    public ViewGroup(string id, string name = null)
    Public Sub New(id As String, name As String = Nothing)
    Parameters
    Type Name Description
    System.String id

    The unique ID of the group

    System.String name

    The unique ID of the name. DEFAULT: null

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown if a view is created with an invalid ID

    Fields

    View Source

    _viewIds

    A set of IDs for the views in this group. This is used to ensure that there are no duplicate IDs used.

    Declaration
    • C#
    • Visual Basic
    [JsonIgnore]
    Dictionary<string, int> _viewIds
    <JsonIgnore>
    _viewIds As Dictionary(Of String, Integer)
    Field Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.Int32>
    View Source

    _views

    The views to display within this group.

    Declaration
    • C#
    • Visual Basic
    [JsonProperty("views", ItemIsReference = true)]
    List<AbstractView> _views
    <JsonProperty("views", ItemIsReference:=True)>
    _views As List(Of AbstractView)
    Field Value
    Type Description
    System.Collections.Generic.List<AbstractView>

    Properties

    View Source

    ViewCount

    The number of views that are in this group.

    Declaration
    • C#
    • Visual Basic
    [JsonIgnore]
    public int ViewCount { get; }
    <JsonIgnore>
    Public ReadOnly Property ViewCount As Integer
    Property Value
    Type Description
    System.Int32
    View Source

    ViewIds

    A list of the IDs of the views in this group

    Declaration
    • C#
    • Visual Basic
    [JsonIgnore]
    public ReadOnlyCollection<string> ViewIds { get; }
    <JsonIgnore>
    Public ReadOnly Property ViewIds As ReadOnlyCollection(Of String)
    Property Value
    Type Description
    System.Collections.ObjectModel.ReadOnlyCollection<System.String>
    View Source

    Views

    The views to display within this group. This is for access only. Use AddView(AbstractView) and UpdateViewById(AbstractView) for setting views/updating them

    Declaration
    • C#
    • Visual Basic
    [JsonIgnore]
    public ReadOnlyCollection<AbstractView> Views { get; }
    <JsonIgnore>
    Public ReadOnly Property Views As ReadOnlyCollection(Of AbstractView)
    Property Value
    Type Description
    System.Collections.ObjectModel.ReadOnlyCollection<AbstractView>

    Methods

    View Source

    AddView(AbstractView)

    Add a view to the group

    Declaration
    • C#
    • Visual Basic
    public virtual void AddView(AbstractView view)
    Public Overridable Sub AddView(view As AbstractView)
    Parameters
    Type Name Description
    AbstractView view
    Exceptions
    Type Condition
    System.ArgumentNullException

    The view or its ID is null

    System.ArgumentException

    There is already a view with the same ID present in the collection

    System.InvalidOperationException

    Thrown when trying to add a ViewGroup to another ViewGroup

    ViewTypeMismatchException

    Thrown when a view group's type does not match its class

    View Source

    AddViews(IEnumerable<AbstractView>)

    Add multiple views to the group

    Declaration
    • C#
    • Visual Basic
    public virtual void AddViews(IEnumerable<AbstractView> views)
    Public Overridable Sub AddViews(views As IEnumerable(Of AbstractView))
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<AbstractView> views
    Exceptions
    Type Condition
    System.ArgumentNullException

    The list of views is null

    View Source

    ContainsViewWithId(String)

    Check to see if a view with a specific ID is present in a collection

    Declaration
    • C#
    • Visual Basic
    public bool ContainsViewWithId(string viewId)
    Public Function ContainsViewWithId(viewId As String) As Boolean
    Parameters
    Type Name Description
    System.String viewId
    Returns
    Type Description
    System.Boolean

    TRUE if the view exists in the collection; FALSE if it does not exist in the collection

    Exceptions
    Type Condition
    System.ArgumentNullException

    The viewId to look for is NULL

    System.IndexOutOfRangeException

    The ID was found, but the view is not in the collection

    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()
    Exceptions
    Type Condition
    System.InvalidOperationException

    Thrown to indicate that this ViewGroup contains other views

    View Source

    GetViewById(String)

    Get the view with a specific ID from a collection

    Declaration
    • C#
    • Visual Basic
    public AbstractView GetViewById(string viewId)
    Public Function GetViewById(viewId As String) As AbstractView
    Parameters
    Type Name Description
    System.String viewId
    Returns
    Type Description
    AbstractView

    The view with the specified ID

    Exceptions
    Type Condition
    System.ArgumentNullException

    The viewId to look for is NULL

    System.IndexOutOfRangeException

    The ID was found, but the view is not in the collection

    System.ArgumentException

    There are no views in the collection

    ViewNotFoundException

    No views with that ID were found in the collection

    ViewTypeMismatchException

    Thrown when a view group's type does not match its class

    View Source

    GetViewById<TViewType>(String)

    Get the view with a specific ID from a collection cast as the target type

    Declaration
    • C#
    • Visual Basic
    public TViewType GetViewById<TViewType>(string viewId)
        where TViewType : AbstractView
    Public Function GetViewById(Of TViewType As AbstractView)(viewId As String) As TViewType
    Parameters
    Type Name Description
    System.String viewId

    The ID of the view to get

    Returns
    Type Description
    TViewType

    The view with the specified ID cast as the target type.

    Type Parameters
    Name Description
    TViewType
    Exceptions
    Type Condition
    System.ArgumentNullException

    An invalid view ID was entered

    System.ArgumentException

    No views are in the group to get

    System.IndexOutOfRangeException

    The ID was found, but the view was not. The group is probably malformed and should be recreated.

    System.Collections.Generic.KeyNotFoundException

    No views with that ID were found

    View Source

    MapViewIds()

    Build a map of view IDs and list indexes for a collection of views

    Declaration
    • C#
    • Visual Basic
    void MapViewIds()
    Sub MapViewIds
    Exceptions
    Type Condition
    System.ArgumentNullException

    The list of views to map is null

    View Source

    RemoveAllViews()

    Clear a collection of views

    Declaration
    • C#
    • Visual Basic
    public virtual void RemoveAllViews()
    Public Overridable Sub RemoveAllViews
    View Source

    SetViews(IEnumerable<AbstractView>)

    Set the list of views in this group

    Declaration
    • C#
    • Visual Basic
    public virtual void SetViews(IEnumerable<AbstractView> views)
    Public Overridable Sub SetViews(views As IEnumerable(Of AbstractView))
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<AbstractView> views
    Exceptions
    Type Condition
    System.ArgumentNullException

    The list of views is null

    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)

    Not used by ViewGroups

    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
    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

    UpdateViewById(AbstractView)

    Perform a soft update to a view in a collection with a particular ID

    Declaration
    • C#
    • Visual Basic
    public void UpdateViewById(AbstractView view)
    Public Sub UpdateViewById(view As AbstractView)
    Parameters
    Type Name Description
    AbstractView view
    Exceptions
    Type Condition
    System.ArgumentNullException

    The viewId to look for is NULL

    System.IndexOutOfRangeException

    The ID was found, but the view is not in the collection

    System.ArgumentException

    There are no views in the collection

    ViewNotFoundException

    No views with that ID were found in the collection

    View Source

    UpdateViewValueById(String, String)

    Declaration
    • C#
    • Visual Basic
    public void UpdateViewValueById(string id, string value)
    Public Sub UpdateViewValueById(id As String, value As String)
    Parameters
    Type Name Description
    System.String id
    System.String value
    • View Source
    In This Article
    Back to top HomeSeer Technologies