Search Results for

    Show / Hide Table of Contents

    Class ViewCollectionHelper

    • C#
    • Visual Basic
    static class ViewCollectionHelper
    Module ViewCollectionHelper
    Inheritance
    System.Object
    ViewCollectionHelper
    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



    Methods

    View Source

    AddView(AbstractView, ref List<AbstractView>, ref Dictionary<String, Int32>, Boolean)

    Add a view to a collection

    Declaration
    • C#
    • Visual Basic
    static void AddView(AbstractView view, ref List<AbstractView> viewList, ref Dictionary<string, int> viewIds, bool toGroup = false)
    Shared Sub AddView(view As AbstractView, ByRef viewList As List(Of AbstractView), ByRef viewIds As Dictionary(Of String, Integer), toGroup As Boolean = False)
    Parameters
    Type Name Description
    AbstractView view

    The view to add to the collection

    System.Collections.Generic.List<AbstractView> viewList

    A reference to the current list of views

    System.Collections.Generic.Dictionary<System.String, System.Int32> viewIds

    A reference to the map of view IDs and list indexes

    System.Boolean toGroup

    If the collection the view is being added it is a ViewGroup. DEFAULT: false for a Page

    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>, ref List<AbstractView>, ref Dictionary<String, Int32>, Boolean)

    Add multiple views to a collection

    Declaration
    • C#
    • Visual Basic
    static void AddViews(IEnumerable<AbstractView> views, ref List<AbstractView> viewList, ref Dictionary<string, int> viewIds, bool toGroup = false)
    Shared Sub AddViews(views As IEnumerable(Of AbstractView), ByRef viewList As List(Of AbstractView), ByRef viewIds As Dictionary(Of String, Integer), toGroup As Boolean = False)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<AbstractView> views

    The views to add to the collection

    System.Collections.Generic.List<AbstractView> viewList

    A reference to the current list of views

    System.Collections.Generic.Dictionary<System.String, System.Int32> viewIds

    A reference to the map of view IDs and list indexes

    System.Boolean toGroup

    If the collection the views are being added it is a ViewGroup. DEFAULT: false for a Page

    Exceptions
    Type Condition
    System.ArgumentNullException

    The list of views is null

    View Source

    ContainsViewWithId(String, ref List<AbstractView>, ref Dictionary<String, Int32>)

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

    Declaration
    • C#
    • Visual Basic
    static bool ContainsViewWithId(string viewId, ref List<AbstractView> viewList, ref Dictionary<string, int> viewIds)
    Shared Function ContainsViewWithId(viewId As String, ByRef viewList As List(Of AbstractView), ByRef viewIds As Dictionary(Of String, Integer)) As Boolean
    Parameters
    Type Name Description
    System.String viewId

    The ID of the view to look for

    System.Collections.Generic.List<AbstractView> viewList

    A reference to the current list of views

    System.Collections.Generic.Dictionary<System.String, System.Int32> viewIds

    A reference to the map of view IDs and list indexes

    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

    GetViewById(String, ref List<AbstractView>, ref Dictionary<String, Int32>)

    Get the view with a specific ID from a collection

    Declaration
    • C#
    • Visual Basic
    static AbstractView GetViewById(string viewId, ref List<AbstractView> viewList, ref Dictionary<string, int> viewIds)
    Shared Function GetViewById(viewId As String, ByRef viewList As List(Of AbstractView), ByRef viewIds As Dictionary(Of String, Integer)) As AbstractView
    Parameters
    Type Name Description
    System.String viewId

    The ID of the view to look for

    System.Collections.Generic.List<AbstractView> viewList

    A reference to the current list of views

    System.Collections.Generic.Dictionary<System.String, System.Int32> viewIds

    A reference to the map of view IDs and list indexes

    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, ref List<AbstractView>, ref Dictionary<String, Int32>)

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

    Declaration
    • C#
    • Visual Basic
    static TViewType GetViewById<TViewType>(string viewId, ref List<AbstractView> viewList, ref Dictionary<string, int> viewIds)
        where TViewType : AbstractView
    Shared Function GetViewById(Of TViewType As AbstractView)(viewId As String, ByRef viewList As List(Of AbstractView), ByRef viewIds As Dictionary(Of String, Integer)) As TViewType
    Parameters
    Type Name Description
    System.String viewId

    The ID of the view to look for

    System.Collections.Generic.List<AbstractView> viewList

    A reference to the current list of views

    System.Collections.Generic.Dictionary<System.String, System.Int32> viewIds

    A reference to the map of view IDs and list indexes

    Returns
    Type Description
    TViewType

    The view with the specified ID cast to the target type

    Type Parameters
    Name Description
    TViewType
    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

    MapViewIds(List<AbstractView>, out Dictionary<String, Int32>, Boolean)

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

    Declaration
    • C#
    • Visual Basic
    static void MapViewIds(List<AbstractView> viewList, out Dictionary<string, int> viewIds, bool calledByGroup = false)
    Shared Sub MapViewIds(viewList As List(Of AbstractView), ByRef viewIds As Dictionary(Of String, Integer), calledByGroup As Boolean = False)
    Parameters
    Type Name Description
    System.Collections.Generic.List<AbstractView> viewList

    A reference to the current list of views

    System.Collections.Generic.Dictionary<System.String, System.Int32> viewIds

    A reference to the map of view IDs and list indexes

    System.Boolean calledByGroup

    Whether the method was called by a ViewGroup or not. Prevents infinite recursion.

    Exceptions
    Type Condition
    System.ArgumentNullException

    The list of views to map is null

    View Source

    RemoveAllViews(out List<AbstractView>, out Dictionary<String, Int32>)

    Clear a collection of views

    Declaration
    • C#
    • Visual Basic
    static void RemoveAllViews(out List<AbstractView> viewList, out Dictionary<string, int> viewIds)
    Shared Sub RemoveAllViews(ByRef viewList As List(Of AbstractView), ByRef viewIds As Dictionary(Of String, Integer))
    Parameters
    Type Name Description
    System.Collections.Generic.List<AbstractView> viewList

    A reference to the current list of views

    System.Collections.Generic.Dictionary<System.String, System.Int32> viewIds

    A reference to the map of view IDs and list indexes

    View Source

    RemoveViewById(String, ref List<AbstractView>, ref Dictionary<String, Int32>)

    Remove a view with the specified ID from the collection.

    Remaining views at indexes greater than the specified view will be moved down one index to fill the empty space

    Declaration
    • C#
    • Visual Basic
    static void RemoveViewById(string viewId, ref List<AbstractView> viewList, ref Dictionary<string, int> viewIds)
    Shared Sub RemoveViewById(viewId As String, ByRef viewList As List(Of AbstractView), ByRef viewIds As Dictionary(Of String, Integer))
    Parameters
    Type Name Description
    System.String viewId

    The ID of the view to remove

    System.Collections.Generic.List<AbstractView> viewList

    The current list of views in the collection

    System.Collections.Generic.Dictionary<System.String, System.Int32> viewIds

    The current view ID to index map for the collection

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown when any of the supplied parameters is null of empty

    System.ArgumentException

    Thrown when the number of items in the viewList and viewIds do not match

    System.Collections.Generic.KeyNotFoundException

    Thrown when a view with the specified ID was not found

    View Source

    RemoveViewsAfterId(String, ref List<AbstractView>, ref Dictionary<String, Int32>)

    Trim all views in the collection following the view with the specified ID

    Declaration
    • C#
    • Visual Basic
    static void RemoveViewsAfterId(string viewId, ref List<AbstractView> viewList, ref Dictionary<string, int> viewIds)
    Shared Sub RemoveViewsAfterId(viewId As String, ByRef viewList As List(Of AbstractView), ByRef viewIds As Dictionary(Of String, Integer))
    Parameters
    Type Name Description
    System.String viewId

    The ID of the view that should be at the end of the collection

    System.Collections.Generic.List<AbstractView> viewList

    The current list of views in the collection

    System.Collections.Generic.Dictionary<System.String, System.Int32> viewIds

    The current view ID to index map for the collection

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown when any of the supplied parameters is null of empty

    System.ArgumentException

    Thrown when the number of items in the viewList and viewIds do not match

    View Source

    SetViews(IEnumerable<AbstractView>, ref List<AbstractView>, ref Dictionary<String, Int32>, Boolean)

    Set the collection of views

    Declaration
    • C#
    • Visual Basic
    static void SetViews(IEnumerable<AbstractView> views, ref List<AbstractView> viewList, ref Dictionary<string, int> viewIds, bool toGroup = false)
    Shared Sub SetViews(views As IEnumerable(Of AbstractView), ByRef viewList As List(Of AbstractView), ByRef viewIds As Dictionary(Of String, Integer), toGroup As Boolean = False)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<AbstractView> views

    The new state of the collection

    System.Collections.Generic.List<AbstractView> viewList

    A reference to the current list of views

    System.Collections.Generic.Dictionary<System.String, System.Int32> viewIds

    A reference to the map of view IDs and list indexes

    System.Boolean toGroup

    If the collection the views are being added it is a ViewGroup. DEFAULT: false for a Page

    Exceptions
    Type Condition
    System.ArgumentNullException

    The list of views is null

    View Source

    UpdateViewById(AbstractView, ref List<AbstractView>, ref Dictionary<String, Int32>)

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

    Declaration
    • C#
    • Visual Basic
    static void UpdateViewById(AbstractView view, ref List<AbstractView> viewList, ref Dictionary<string, int> viewIds)
    Shared Sub UpdateViewById(view As AbstractView, ByRef viewList As List(Of AbstractView), ByRef viewIds As Dictionary(Of String, Integer))
    Parameters
    Type Name Description
    AbstractView view

    The new state of the view to update

    System.Collections.Generic.List<AbstractView> viewList

    A reference to the current list of views

    System.Collections.Generic.Dictionary<System.String, System.Int32> viewIds

    A reference to the map of view IDs and list indexes

    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, ref List<AbstractView>, ref Dictionary<String, Int32>)

    Declaration
    • C#
    • Visual Basic
    static void UpdateViewValueById(string id, string value, ref List<AbstractView> viewList, ref Dictionary<string, int> viewIds)
    Shared Sub UpdateViewValueById(id As String, value As String, ByRef viewList As List(Of AbstractView), ByRef viewIds As Dictionary(Of String, Integer))
    Parameters
    Type Name Description
    System.String id
    System.String value
    System.Collections.Generic.List<AbstractView> viewList
    System.Collections.Generic.Dictionary<System.String, System.Int32> viewIds
    • View Source
    In This Article
    Back to top HomeSeer Technologies