private void Main_Load(object sender, EventArgs e) { //Cursor.Hide(); InitalizeDatabase(); InitalizeWebBrowser(); line1.Add(button1); line1.Add(button2); line1.Add(button3); line1.Add(button4); line1.Add(button5); line1.Add(button6); line1.Add(button7); line1.Add(button9); line1.Add(button11); line1.Add(button8); line1.Add(button10); line1.Add(button12); line2.Add(button18); line2.Add(button23); line2.Add(button29); line2.Add(button20); line2.Add(button25); line2.Add(button31); line2.Add(button19); line2.Add(button24); line2.Add(button30); line2.Add(button21); line2.Add(button26); line2.Add(button32); line3.Add(button13); line3.Add(button14); line3.Add(button15); line3.Add(button16); line3.Add(button17); line3.Add(button22); line3.Add(button27); line3.Add(button33); line3.Add(button28); line3.Add(button34); line3.Add(button35); line3.Add(button36); RemoteRecive.Start(); }
private async void Recive() { try { FirebaseResponse response = await client.GetAsync(@"Actions/action"); if (response.StatusCode == System.Net.HttpStatusCode.NotFound && response.StatusCode == System.Net.HttpStatusCode.BadRequest) { RemoteRecive.Interval = 1000; } else if (respold != response.Body) { respold = response.Body; if (response.Body.Contains("up")) { GoUp(); } else if (response.Body.Contains("down")) { GoDown(); } else if (response.Body.Contains("left")) { GoLeft(); } else if (response.Body.Contains("right")) { GoRight(); } else if (response.Body.Contains("enter")) { if (controllerControlling == "keyboard") { if (curentLetter == "OK") { Search(textBox1.Text); youTubeSearch.BringToFront(); youTubeSearch.Visible = true; controllerControlling = "youtubeSearchSelection"; virtualKeyboard.SendToBack(); virtualKeyboard.Visible = false; } else { textBox1.Text += curentLetter; } } else if (controllerControlling == "youtubeSearchSelection") { videoSearchResultsOnDisplay[curentVideoSearchLine][curentVideoSearchRow].Play(); controllerControlling = "playingVideo"; } else if (controllerControlling == "playingVideo") { PauseAndCloseAdd(); } } else if (response.Body.Contains("back")) { if (controllerControlling == "playingVideo") { webBrowser.SendToBack(); webBrowser.Visible = false; browser.LoadHtml(""); controllerControlling = "youtubeSearchSelection"; } else if (controllerControlling == "youtubeSearchSelection") { youTubeSearch.SendToBack(); youTubeSearch.Visible = false; browser.LoadHtml(""); controllerControlling = "keyboard"; virtualKeyboard.BringToFront(); virtualKeyboard.Visible = true; } } } label1.Text = response.Body; } catch { RemoteRecive.Interval = 1000; } RemoteRecive.Start(); }