private void button6_Click(object sender, EventArgs e) { if (counter != 0) { SingleConnection.send(counter.ToString()); this.Hide(); Select_Video_Form f1 = new Select_Video_Form(); f1.ShowDialog(); } else { MessageBox.Show("You must rate the video"); } }
void menuItem_Click(object sender, EventArgs e) { ToolStripItem menuItem = (ToolStripItem)sender; string name = listView1.SelectedItems[0].Text; if (menuItem.Name == "play") { SingleConnection.send(name); // send the name of the song that pressed this.Hide(); Buttons_Form bf = new Buttons_Form(); bf.ShowDialog(); } if (menuItem.Name == "Play from the last viewing point") { SingleConnection.send(name + "#" + this.movie_time_dict[name]); this.Hide(); this.time = (this.movie_time_dict[name] / 3) + 1; Console.WriteLine(this.time); this.with_for = true; using (Loading_Form f_load = new Loading_Form(SaveData)) { f_load.ShowDialog(this); } Buttons_Form bf = new Buttons_Form(); bf.ShowDialog(); } if (menuItem.Name == "Download for later viewing") { this.Hide(); SingleConnection.send("Download@" + name); this.with_for = false; Thread download_thread = new Thread(new ThreadStart(this.download)); download_thread.Start(); using (Loading_Form f_load = new Loading_Form(SaveData)) { f_load.ShowDialog(this); } Select_Video_Form f1 = new Select_Video_Form(); f1.ShowDialog(); } if (menuItem.Name == "Play without connection") { SingleConnection.send("play_without_connection!" + name); this.Hide(); Buttons_Form bf = new Buttons_Form(); bf.ShowDialog(); } }
private void ButtonsForm_FormClosing(object sender, FormClosingEventArgs e) { SingleConnection.send("close"); Console.WriteLine("here after hide"); //SingleConnection.StopPythonEngine(); while (this.open && this.close) { Console.WriteLine("wait"); } this.Hide(); if (this.open) { Select_Video_Form f1 = new Select_Video_Form(); f1.ShowDialog(); } }
private void button2_Click(object sender, EventArgs e) { string username = textBox1.Text; string password = textBox2.Text; SingleConnection.send(username + "<&>" + password); string message = SingleConnection.recv(); if (message == "ok") { Select_Video_Form form1 = new Select_Video_Form(); this.Hide(); form1.ShowDialog(); } else { MessageBox.Show(message); } }