Search Results for

    Show / Hide Table of Contents

    Class AbstractActionType2

    • C#
    • Visual Basic
    public abstract class AbstractActionType2 : AbstractActionType
    Public MustInherit Class AbstractActionType2
        Inherits AbstractActionType
    Inheritance
    System.Object
    AbstractActionType
    AbstractActionType2
    Inherited Members
    AbstractActionType.LogDebug
    AbstractActionType.ActionListener
    AbstractActionType.Id
    AbstractActionType.EventRef
    AbstractActionType.Data
    AbstractActionType.Name
    AbstractActionType.SelectedSubActionIndex
    AbstractActionType.PageId
    AbstractActionType.ConfigPage
    AbstractActionType._id
    AbstractActionType._eventRef
    AbstractActionType._data
    AbstractActionType._configPage
    AbstractActionType._inData
    AbstractActionType.GetName()
    AbstractActionType.IsFullyConfigured()
    AbstractActionType.OnEditAction(Page)
    AbstractActionType.OnConfigItemUpdate(AbstractView)
    AbstractActionType.GetPrettyString()
    AbstractActionType.OnRunAction()
    AbstractActionType.ReferencesDeviceOrFeature(Int32)
    AbstractActionType.ToHtml()
    AbstractActionType.ProcessPostData(Dictionary<String, String>)
    AbstractActionType.ConvertLegacyData(Byte[])
    AbstractActionType.InflateActionFromData()
    AbstractActionType.Equals(Object)
    AbstractActionType.GetHashCode()
    System.Object.ToString()
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: HomeSeer.PluginSdk.Events
    Assembly: PluginSdk.dll


    The base implementation of a plugin action type available for users to select in HomeSeer

    The difference between AbstractActionType2 and AbstractActionType, is that with AbstractActionType2 only a collection of view Id/Value pairs is stored in database whereas with AbstractActionType the whole ConfigPage is stored. This allows the plugin to build the views in OnInstantiateAction(Dictionary<String, String>) every time an action is instantiated.

    Inherit from this class to define your own action types and store them in your plugin's ActionTypeCollection


    Constructors

    View Source

    AbstractActionType2()

    Initialize a new, unconfigured AbstractActionType2

    This is called through reflection by the ActionTypeCollection class if a class that derives from this type is added to its list.

    Declaration
    • C#
    • Visual Basic
    protected AbstractActionType2()
    Protected Sub New
    View Source

    AbstractActionType2(Int32, Int32, Byte[], ActionTypeCollection.IActionTypeListener)

    Initialize a new AbstractActionType2 with the specified ID, Event Ref, and Data byte array. The byte array will be automatically parsed to a collection of view Id/Value pairs, and OnInstantiateAction(Dictionary<String, String>) will be called.

    This is called through reflection by the ActionTypeCollection class if a class that derives from this type is added to its list.

    You MUST implement one of these constructors in any class that derives from AbstractActionType2

    Declaration
    • C#
    • Visual Basic
    protected AbstractActionType2(int id, int eventRef, byte[] dataIn, ActionTypeCollection.IActionTypeListener listener)
    Protected Sub New(id As Integer, eventRef As Integer, dataIn As Byte(), listener As ActionTypeCollection.IActionTypeListener)
    Parameters
    Type Name Description
    System.Int32 id

    The unique ID of this action in HomeSeer

    System.Int32 eventRef

    The event reference ID that this action is associated with in HomeSeer

    System.Byte[] dataIn

    A byte array containing a collection of view Id/Value pairs

    ActionTypeCollection.IActionTypeListener listener

    The listener that facilitates the communication with AbstractPlugin

    View Source

    AbstractActionType2(Int32, Int32, Byte[], ActionTypeCollection.IActionTypeListener, Boolean)

    Initialize a new AbstractActionType2 with the specified ID, Event Ref, Data byte array, listener, and logDebug flag. The byte array will be automatically parsed to a collection of view Id/Value pairs, and OnInstantiateAction(Dictionary<String, String>) will be called

    This is called through reflection by the ActionTypeCollection class if a class that derives from this type is added to its list.

    You MUST implement one of these constructors in any class that derives from AbstractActionType2

    Declaration
    • C#
    • Visual Basic
    protected AbstractActionType2(int id, int eventRef, byte[] dataIn, ActionTypeCollection.IActionTypeListener listener, bool logDebug = false)
    Protected Sub New(id As Integer, eventRef As Integer, dataIn As Byte(), listener As ActionTypeCollection.IActionTypeListener, logDebug As Boolean = False)
    Parameters
    Type Name Description
    System.Int32 id

    The unique ID of this action in HomeSeer

    System.Int32 eventRef

    The event reference ID that this action is associated with in HomeSeer

    System.Byte[] dataIn

    A byte array containing a collection of view Id/Value pairs

    ActionTypeCollection.IActionTypeListener listener

    The listener that facilitates the communication with AbstractPlugin

    System.Boolean logDebug

    If true debug messages will be written to the console

    View Source

    AbstractActionType2(Int32, Int32, Int32, Byte[], ActionTypeCollection.IActionTypeListener)

    Initialize a new AbstractActionType2 with the specified ID, SubType number, Event Ref, Data byte array and listener. The byte array will be automatically parsed to a collection of view Id/Value pairs, and OnInstantiateAction(Dictionary<String, String>) will be called

    This is called through reflection by the ActionTypeCollection class if a class that derives from this type is added to its list.

    You MUST implement one of these constructors in any class that derives from AbstractActionType2

    Declaration
    • C#
    • Visual Basic
    protected AbstractActionType2(int id, int subTypeNumber, int eventRef, byte[] dataIn, ActionTypeCollection.IActionTypeListener listener)
    Protected Sub New(id As Integer, subTypeNumber As Integer, eventRef As Integer, dataIn As Byte(), listener As ActionTypeCollection.IActionTypeListener)
    Parameters
    Type Name Description
    System.Int32 id

    The unique ID of this action in HomeSeer

    System.Int32 subTypeNumber

    The action subtype number

    System.Int32 eventRef

    The event reference ID that this action is associated with in HomeSeer

    System.Byte[] dataIn

    A byte array containing a collection of view Id/Value pairs

    ActionTypeCollection.IActionTypeListener listener

    The listener that facilitates the communication with AbstractPlugin

    Methods

    View Source

    GetData()

    Declaration
    • C#
    • Visual Basic
    override byte[] GetData()
    Overrides Function GetData As Byte()
    Returns
    Type Description
    System.Byte[]
    Overrides
    AbstractActionType.GetData()
    View Source

    OnInstantiateAction(Dictionary<String, String>)

    Called when an action of this type is being instantiated. Create the ConfigPage according to the values passed as parameters. If no value is passed it means it's a new action, so initialize the ConfigPage to the action's starting state so users can begin configuring it.

    Any JUI view added to the ConfigPage must use a unique ID as it will be displayed on an event page that could also be housing HTML from other plugins. It is recommended to use the PageId as a prefix for all views added to ensure that their IDs are unique.

    View Id/Value pairs containing the existing values for this action
    Declaration
    • C#
    • Visual Basic
    protected abstract void OnInstantiateAction(Dictionary<string, string> viewIdValuePairs)
    Protected MustOverride Sub OnInstantiateAction(viewIdValuePairs As Dictionary(Of String, String))
    Parameters
    Type Name Description
    System.Collections.Generic.Dictionary<System.String, System.String> viewIdValuePairs
    View Source

    OnNewAction()

    Called when a new action of this type is being created. Initialize the ConfigPage to the action's starting state so users can begin configuring it.

    Initialize a new ConfigPage and add views to it so the user can configure the trigger. Any JUI view added to the ConfigPage must use a unique ID as it will be displayed on an event page that could also be housing HTML from other plugins. It is recommended to use the PageId as a prefix for all views added to ensure that their IDs are unique.

    Declaration
    • C#
    • Visual Basic
    protected override void OnNewAction()
    Protected Overrides Sub OnNewAction
    Overrides
    AbstractActionType.OnNewAction()
    Remarks

    With AbstractActionType2 there is no need to override this method. OnInstantiateAction(Dictionary<String, String>) will be called instead, with an empty Dictionary as parameter.

    View Source

    ProcessData(Byte[])

    Declaration
    • C#
    • Visual Basic
    override byte[] ProcessData(byte[] inData)
    Overrides Function ProcessData(inData As Byte()) As Byte()
    Parameters
    Type Name Description
    System.Byte[] inData
    Returns
    Type Description
    System.Byte[]
    Overrides
    AbstractActionType.ProcessData(Byte[])
    • View Source
    In This Article
    Back to top HomeSeer Technologies