Example #1
0
        static void SDKCallback(int eventType, int eventValue, System.String eventArg, System.IntPtr context)
        {
            if (eventType == LogitechArx.LOGI_ARX_EVENT_MOBILEDEVICE_ARRIVAL)
            {
                // Initilize Environment
                if (!LogitechArx.LogiArxAddFileAs("view.html", "view.html"))
                {
                    int retCode = LogitechArx.LogiArxGetLastError();
                    Debug.WriteLine("exec failed: " + retCode);
                }

                if (!LogitechArx.LogiArxAddFileAs("bootstrap.min.css", "bootstrap.min.css"))
                {
                    int retCode = LogitechArx.LogiArxGetLastError();
                    Debug.WriteLine("exec failed: " + retCode);
                }

                if (!LogitechArx.LogiArxAddFileAs("bootstrap.min.js", "bootstrap.min.js"))
                {
                    int retCode = LogitechArx.LogiArxGetLastError();
                    Debug.WriteLine("exec failed: " + retCode);
                }

                if (!LogitechArx.LogiArxSetIndex("view.html"))
                {
                    int retCode = LogitechArx.LogiArxGetLastError();
                    Debug.WriteLine("exec failed: " + retCode);
                }
            }
            else if (eventType == LogitechArx.LOGI_ARX_EVENT_MOBILEDEVICE_REMOVAL)
            {
                // Handle Disconnect
            }
            else if (eventType == LogitechArx.LOGI_ARX_EVENT_TAP_ON_TAG)
            {
                // Handle Inputs
            }
        }
Example #2
0
        void callback(int eventType, int eventValue, System.String eventArg, System.IntPtr context)
        {
            if (eventType == LogitechArx.LOGI_ARX_EVENT_MOBILEDEVICE_ARRIVAL)
            {
                LogitechArx.LogiArxAddFileAs("index.html", "index.html", "text/html");
                Thread.Sleep(1000);
                LogitechArx.LogiArxAddFileAs("jquery.min.js", "jquery.min.js", "text/html");
                Thread.Sleep(1000);
                LogitechArx.LogiArxSetIndex("index.html");
                try
                {
                    if (twitchUser == null)
                    {
                        MessageBox.Show("You are not logged in!", "Login");
                    }
                    else
                    {
                        update();
                    }
                }
                catch { }
            }
            else if (eventType == LogitechArx.LOGI_ARX_EVENT_MOBILEDEVICE_REMOVAL)
            {
            }
            else if (eventType == LogitechArx.LOGI_ARX_EVENT_FOCUS_ACTIVE)
            {
                if (twitchUser == null)
                {
                    MessageBox.Show("You are not logged in!", "Login");
                }
                else
                {
                    update();
                }
            }
            else if (eventType == LogitechArx.LOGI_ARX_EVENT_FOCUS_INACTIVE)
            {
            }
            else if (eventType == LogitechArx.LOGI_ARX_EVENT_TAP_ON_TAG)
            {
                if (twitchUser == null)
                {
                    MessageBox.Show("You are not logged in!", "Login");
                }
                else
                {
                    switch (eventArg)
                    {
                    case "makeCommercial30":
                        twitchUser.StartCommercial(TwitchConstants.CommercialLength.Sec30);
                        break;

                    case "makeCommercial60":
                        twitchUser.StartCommercial(TwitchConstants.CommercialLength.Sec60);
                        break;

                    case "makeCommercial90":
                        twitchUser.StartCommercial(TwitchConstants.CommercialLength.Sec90);
                        break;

                    case "makeCommercial120":
                        twitchUser.StartCommercial(TwitchConstants.CommercialLength.Sec120);
                        break;

                    case "makeCommercial150":
                        twitchUser.StartCommercial(TwitchConstants.CommercialLength.Sec150);
                        break;

                    case "makeCommercial180":
                        twitchUser.StartCommercial(TwitchConstants.CommercialLength.Sec180);
                        break;
                    }
                }
            }
        }