Search Results for

    Show / Hide Table of Contents

    Class BaseTypeCollection<TBaseItemType>

    • C#
    • Visual Basic
    public class BaseTypeCollection<TBaseItemType>
    Public Class BaseTypeCollection(Of TBaseItemType)
    Inheritance
    System.Object
    BaseTypeCollection<TBaseItemType>
    ActionTypeCollection
    TriggerTypeCollection
    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.PluginSdk.Events
    Assembly: PluginSdk.dll


    A collection for holding types of classes that adhere to certain structural rules.


    Type Parameters
    Name Description
    TBaseItemType

    The type of item to manage

    Fields

    View Source

    _itemTypeNames

    System.Collections.Generic.HashSet<T> of class names representing the System.Type in _itemTypes

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

    _itemTypes

    System.Collections.Generic.List<T> of System.Type that are a subclass of TBaseItemType

    Declaration
    • C#
    • Visual Basic
    protected List<Type> _itemTypes
    Protected _itemTypes As List(Of Type)
    Field Value
    Type Description
    System.Collections.Generic.List<System.Type>

    Properties

    View Source

    ConstructorSignatures

    A System.Collections.Generic.List<T> of constructor signatures

    Declaration
    • C#
    • Visual Basic
    protected List<Type[]> ConstructorSignatures { get; set; }
    Protected Property ConstructorSignatures As List(Of Type())
    Property Value
    Type Description
    System.Collections.Generic.List<System.Type[]>
    View Source

    Count

    The number of types that are supported by the collection

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

    MatchAllSignatures

    Whether the items in the collection must match all of the listed ConstructorSignatures or just one. true if the items must match all constructor signatures.

    Declaration
    • C#
    • Visual Basic
    protected bool MatchAllSignatures { get; set; }
    Protected Property MatchAllSignatures As Boolean
    Property Value
    Type Description
    System.Boolean

    Methods

    View Source

    AddItemType(Type)

    Add the specified class type that derives from TBaseItemType to the list of item types

    Declaration
    • C#
    • Visual Basic
    protected void AddItemType(Type itemType)
    Protected Sub AddItemType(itemType As Type)
    Parameters
    Type Name Description
    System.Type itemType

    The System.Type of the class that derives from TBaseItemType

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when the specified class type will not work as the desired type

    View Source

    AssertTypeHasConstructor(Type, Type[])

    Declaration
    • C#
    • Visual Basic
    static void AssertTypeHasConstructor(Type targetType, Type[] constructorParams)
    Shared Sub AssertTypeHasConstructor(targetType As Type, constructorParams As Type())
    Parameters
    Type Name Description
    System.Type targetType
    System.Type[] constructorParams
    View Source

    AssertTypeHasConstructors(Type)

    Declaration
    • C#
    • Visual Basic
    void AssertTypeHasConstructors(Type targetType)
    Sub AssertTypeHasConstructors(targetType As Type)
    Parameters
    Type Name Description
    System.Type targetType
    View Source

    AssertTypeHasEmptyConstructor(Type)

    Declaration
    • C#
    • Visual Basic
    void AssertTypeHasEmptyConstructor(Type targetType)
    Sub AssertTypeHasEmptyConstructor(targetType As Type)
    Parameters
    Type Name Description
    System.Type targetType
    View Source

    GetObjectFromInfo(Int32)

    Get an instance of an object of the type defined at a specific index in the collection

    Declaration
    • C#
    • Visual Basic
    protected TBaseItemType GetObjectFromInfo(int itemIndex)
    Protected Function GetObjectFromInfo(itemIndex As Integer) As TBaseItemType
    Parameters
    Type Name Description
    System.Int32 itemIndex

    The index of the type to use

    Returns
    Type Description
    TBaseItemType
    Exceptions
    Type Condition
    System.Collections.Generic.KeyNotFoundException

    Thrown when no item is found at the specified index

    System.TypeLoadException

    Thrown when there was an error while creating an instance of the specified type

    View Source

    GetObjectFromInfo(Int32, Int32, Object[])

    Get an instance of an object of the type defined at a specific index in the collection

    Declaration
    • C#
    • Visual Basic
    protected TBaseItemType GetObjectFromInfo(int itemIndex, int signatureIndex, params object[] inParams)
    Protected Function GetObjectFromInfo(itemIndex As Integer, signatureIndex As Integer, ParamArray inParams As Object()) As TBaseItemType
    Parameters
    Type Name Description
    System.Int32 itemIndex

    The index of the type to use

    System.Int32 signatureIndex

    The index of the constructor signature to use

    System.Object[] inParams

    The parameters to pass to the constructor

    Returns
    Type Description
    TBaseItemType
    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when there was an issue with the provided parameters

    View Source

    TypeHasConstructor(Int32, Int32)

    Determine if a specific type has a particular constructor signature defined

    Declaration
    • C#
    • Visual Basic
    protected bool TypeHasConstructor(int itemIndex, int signatureIndex)
    Protected Function TypeHasConstructor(itemIndex As Integer, signatureIndex As Integer) As Boolean
    Parameters
    Type Name Description
    System.Int32 itemIndex

    The index of the type to use

    System.Int32 signatureIndex

    The index of the constructor signature to use

    Returns
    Type Description
    System.Boolean

    true if the type has the specific constructor defined

    Exceptions
    Type Condition
    System.Collections.Generic.KeyNotFoundException

    Thrown if a type or signature was not found at the specified index

    See Also

    ActionTypeCollection
    TriggerTypeCollection
    • View Source
    In This Article
    Back to top HomeSeer Technologies