RegisterCallBack

From HomeSeer

Jump to: navigation, search

RegisterCallBack()

Type:

None

Parameters:

frm as object

Status:

In Use

Contents

[edit] Description

This important procedure is where your plug-in gets its reference to HomeSeer - that is, it is the method used for you to get an object reference to the HomeSeer plug-in interface which contains procedures not available to scripts, and that object is also used to call GetHSIface to retrieve your HomeSeer reference for access to the scripting interface calls. Your plug-in should have a couple of global variables defined as objects and called callback and hs. The callback reference will be used for some plug-in specific procedures, and the hs object will be used to call script commands.

[edit] Parameters

None

[edit] Returns

Return value: frm

Return type: Object

[edit] Example

Public Function RegisterCallBack(ByVal frm as object)
    callback = frm
    hs = frm.GetHSIface
End Function

[edit] C# Example

        /// <summary>Our instance of the Application class, retrieved from the callback class.</summary>
        static public Scheduler.hsapplication hs;
        /// <summary>Our instance of the Scheduler Callback.  </summary>
        static public Scheduler.clsHSPI callback;

        /// <param name="frm">Reference to the Scheduler.clsHSPI instance.</param>
        static public void RegisterCallback(Object frm)
        {
            callback = (Scheduler.clsHSPI)frm
            hs = (Scheduler.hsapplication)callback.GetHSIface();
        }

See the Writing Plug-Ins In C# page for more C# help.

Personal tools