Search Results for

    Show / Hide Table of Contents

    Class ActionTypeCollection

    • C#
    • Visual Basic
    public class ActionTypeCollection : BaseTypeCollection<AbstractActionType>
    Public Class ActionTypeCollection
        Inherits BaseTypeCollection(Of AbstractActionType)
    Inheritance
    System.Object
    BaseTypeCollection<AbstractActionType>
    ActionTypeCollection
    Inherited Members
    BaseTypeCollection<AbstractActionType>.Count
    BaseTypeCollection<AbstractActionType>.ConstructorSignatures
    BaseTypeCollection<AbstractActionType>.MatchAllSignatures
    BaseTypeCollection<AbstractActionType>._itemTypes
    BaseTypeCollection<AbstractActionType>._itemTypeNames
    BaseTypeCollection<AbstractActionType>.AddItemType(Type)
    BaseTypeCollection<AbstractActionType>.GetObjectFromInfo(Int32)
    BaseTypeCollection<AbstractActionType>.GetObjectFromInfo(Int32, Int32, Object[])
    BaseTypeCollection<AbstractActionType>.TypeHasConstructor(Int32, Int32)
    BaseTypeCollection<AbstractActionType>.AssertTypeHasConstructors(Type)
    BaseTypeCollection<AbstractActionType>.AssertTypeHasEmptyConstructor(Type)
    BaseTypeCollection<AbstractActionType>.AssertTypeHasConstructor(Type, Type[])
    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 of AbstractActionTypes that can be used by users to create HomeSeer Event Actions.

    An instance of this class is a field on AbstractPlugin initialized in the constructor. In addition, all calls from HomeSeer related to actions are automatically routed through that instance.


    Remarks

    Add action types supported by your plugin using AddActionType(Type)

    Due to the fact that HomeSeer saves the index of the action type in its internal database, avoid changing the index of any of the types available to the user. Doing so may result in an incorrect AbstractActionType being instantiated and producing errors because the configuration parameters and signature of the action type do not match.

    Constructors

    View Source

    ActionTypeCollection(ActionTypeCollection.IActionTypeListener)

    Initialize a new instance of an ActionTypeCollection with the specified listener

    Declaration
    • C#
    • Visual Basic
    public ActionTypeCollection(ActionTypeCollection.IActionTypeListener listener)
    Public Sub New(listener As ActionTypeCollection.IActionTypeListener)
    Parameters
    Type Name Description
    ActionTypeCollection.IActionTypeListener listener

    An ActionTypeCollection.IActionTypeListener that will be passed to action types

    Fields

    View Source

    _listener

    Declaration
    • C#
    • Visual Basic
    ActionTypeCollection.IActionTypeListener _listener
    _listener As ActionTypeCollection.IActionTypeListener
    Field Value
    Type Description
    ActionTypeCollection.IActionTypeListener

    Properties

    View Source

    ActionTypes

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

    Declaration
    • C#
    • Visual Basic
    public List<Type> ActionTypes { get; }
    Public ReadOnly Property ActionTypes As List(Of Type)
    Property Value
    Type Description
    System.Collections.Generic.List<System.Type>
    Remarks

    These represent the types of AbstractActionType that are available for users

    View Source

    LogDebug

    Used to enable/disable internal logging to the console

    When it is TRUE, log messages from the PluginSdk code will be written to the Console

    Declaration
    • C#
    • Visual Basic
    public bool LogDebug { get; set; }
    Public Property LogDebug As Boolean
    Property Value
    Type Description
    System.Boolean

    Methods

    View Source

    ActionReferencesDeviceOrFeature(Int32, TrigActInfo)

    Called by HomeSeer when it needs to determine if a specific device/feature is referenced by a particular action.

    Declaration
    • C#
    • Visual Basic
    public bool ActionReferencesDeviceOrFeature(int devOrFeatRef, TrigActInfo actInfo)
    Public Function ActionReferencesDeviceOrFeature(devOrFeatRef As Integer, actInfo As TrigActInfo) As Boolean
    Parameters
    Type Name Description
    System.Int32 devOrFeatRef

    The unique Ref of the device/feature

    TrigActInfo actInfo

    The action to check

    Returns
    Type Description
    System.Boolean

    TRUE if the action references the specified device/feature, FALSE if it does not.

    View Source

    AddActionType(Type)

    Add the specified class type that derives from AbstractActionType to the list of actions

    Declaration
    • C#
    • Visual Basic
    public void AddActionType(Type actionType)
    Public Sub AddActionType(actionType As Type)
    Parameters
    Type Name Description
    System.Type actionType

    The System.Type of the class that derives from AbstractActionType

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when the specified class type will not work as an action

    View Source

    GetName(Int32)

    Get the name of the action type at the specified index

    Declaration
    • C#
    • Visual Basic
    public string GetName(int actionIndex)
    Public Function GetName(actionIndex As Integer) As String
    Parameters
    Type Name Description
    System.Int32 actionIndex

    The 1 based index of the action type to get the name for

    Returns
    Type Description
    System.String

    The name of the action type

    View Source

    GetObjectFromActInfo(TrigActInfo)

    Get an instance of an AbstractActionType from a TrigActInfo.

    Declaration
    • C#
    • Visual Basic
    public AbstractActionType GetObjectFromActInfo(TrigActInfo actInfo)
    Public Function GetObjectFromActInfo(actInfo As TrigActInfo) As AbstractActionType
    Parameters
    Type Name Description
    TrigActInfo actInfo

    An instance of TrigActInfo that represents an action.

    Returns
    Type Description
    AbstractActionType

    An instance of an AbstractActionType. This will be one of the types in the ActionTypes list.

    Remarks

    TANumber is used to identify which of the AbstractActionTypes is used.

    Exceptions
    Type Condition
    System.TypeLoadException

    Thrown if the AbstractActionType that is referenced by TANumber does not have the proper constructor.

    • AbstractActionType(Int32, Int32, Int32, Byte[], ActionTypeCollection.IActionTypeListener)
    • AbstractActionType(Int32, Int32, Byte[], ActionTypeCollection.IActionTypeListener, Boolean)
    • AbstractActionType(Int32, Int32, Byte[], ActionTypeCollection.IActionTypeListener)
    View Source

    HandleAction(TrigActInfo)

    Called by HomeSeer when an event has been triggered and a corresponding action needs to be processed.

    Declaration
    • C#
    • Visual Basic
    public bool HandleAction(TrigActInfo actInfo)
    Public Function HandleAction(actInfo As TrigActInfo) As Boolean
    Parameters
    Type Name Description
    TrigActInfo actInfo

    The action that is being executed

    Returns
    Type Description
    System.Boolean

    TRUE if the action executed successfully, FALSE if there was an error executing the action.

    View Source

    IsActionConfigured(TrigActInfo)

    Called by HomeSeer when it needs to determine if a specific action is completely configured or requires additional configuration before it can be used.

    Declaration
    • C#
    • Visual Basic
    public bool IsActionConfigured(TrigActInfo actInfo)
    Public Function IsActionConfigured(actInfo As TrigActInfo) As Boolean
    Parameters
    Type Name Description
    TrigActInfo actInfo

    The action to check

    Returns
    Type Description
    System.Boolean

    TRUE if the action is completely configured, FALSE if it is not. A call to OnGetActionUi(TrigActInfo) will be called following this if FALSE is returned.

    View Source

    OnGetActionPrettyString(TrigActInfo)

    Called by HomeSeer when it needs to get an easy to read, formatted string that communicates what the action does to the user.

    Declaration
    • C#
    • Visual Basic
    public string OnGetActionPrettyString(TrigActInfo actInfo)
    Public Function OnGetActionPrettyString(actInfo As TrigActInfo) As String
    Parameters
    Type Name Description
    TrigActInfo actInfo

    The action that a pretty string is needed for

    Returns
    Type Description
    System.String

    HTML formatted text communicating what the action does

    View Source

    OnGetActionUi(TrigActInfo)

    Called by HomeSeer when it needs to display the configuration UI for an action type

    Declaration
    • C#
    • Visual Basic
    public string OnGetActionUi(TrigActInfo actInfo)
    Public Function OnGetActionUi(actInfo As TrigActInfo) As String
    Parameters
    Type Name Description
    TrigActInfo actInfo

    The action to display as defined by TrigActInfo

    Returns
    Type Description
    System.String

    HTML to display on the event page for the specified action

    View Source

    OnUpdateActionConfig(Dictionary<String, String>, TrigActInfo)

    Called by HomeSeer when a user updates the configuration of an action and those changes are in need of processing.

    Declaration
    • C#
    • Visual Basic
    public EventUpdateReturnData OnUpdateActionConfig(Dictionary<string, string> postData, TrigActInfo actInfo)
    Public Function OnUpdateActionConfig(postData As Dictionary(Of String, String), actInfo As TrigActInfo) As EventUpdateReturnData
    Parameters
    Type Name Description
    System.Collections.Generic.Dictionary<System.String, System.String> postData

    A System.Collections.Generic.Dictionary<TKey, TValue> of changes to the action configuration

    TrigActInfo actInfo

    The action being configured

    Returns
    Type Description
    EventUpdateReturnData

    An EventUpdateReturnData describing the new state of the action that will be saved by HomeSeer. The action configuration will be saved if the result returned is an empty string.

    • View Source
    In This Article
    Back to top HomeSeer Technologies