private void textBox1_TextChanged(object sender, EventArgs e) { SingleConnection.send("%" + textBox1.Text); string message = SingleConnection.recv(); this.change_list_view(message); }
private void FormHandler1() { SingleConnection.send("close the wait for commands thread in client"); Console.WriteLine("hide"); this.Hide(); Rate_Form f2 = new Rate_Form(); f2.ShowDialog(); }
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 listView1_MouseClick(object sender, MouseEventArgs e) { string name = listView1.SelectedItems[0].Text; if (e.Button == MouseButtons.Right) { ContextMenuStrip menuStrip = new ContextMenuStrip(); ToolStripMenuItem menuItem1 = new ToolStripMenuItem("Play"); menuStrip.Items.Add(menuItem1); menuItem1.Click += new EventHandler(menuItem_Click); menuItem1.Name = "play"; if (video_is_download(name)) { ToolStripMenuItem menuItem4 = new ToolStripMenuItem("Play without connection"); menuStrip.Items.Add(menuItem4); menuItem4.Click += new EventHandler(menuItem_Click); menuItem4.Name = "Play without connection"; } else { ToolStripMenuItem menuItem4 = new ToolStripMenuItem("Download for later viewing"); menuStrip.Items.Add(menuItem4); menuItem4.Click += new EventHandler(menuItem_Click); menuItem4.Name = "Download for later viewing"; } if (this.movie_time_dict.ContainsKey(name)) { ToolStripMenuItem menuItem2 = new ToolStripMenuItem("Play from the last viewing point- " + this.movie_time_dict[name] + " sec"); menuStrip.Items.Add(menuItem2); menuItem2.Click += new EventHandler(menuItem_Click); menuItem2.Name = "Play from the last viewing point"; } if (this.movie_rate_dict.ContainsKey(name)) { ToolStripMenuItem menuItem3 = new ToolStripMenuItem("Rate: " + this.movie_rate_dict[name]); menuStrip.Items.Add(menuItem3); } this.ContextMenuStrip = menuStrip; } else { SingleConnection.send(name); // send the name of the song that pressed this.Hide(); Buttons_Form bf = new Buttons_Form(); bf.Show(); } }
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); } }
private void button3_Click(object sender, EventArgs e) { SingleConnection.send("plus"); }
private void button5_Click(object sender, EventArgs e) { SingleConnection.send("mute"); }
private void button2_Click(object sender, EventArgs e) { SingleConnection.send("stop"); }