protected override void OnClosing(CancelEventArgs e) { // If the user tries to close the window without doing a clean // shutdown of the remote connection, do it for them. if (remoteDesktop.IsConnected) { remoteDesktop.Disconnect(); } base.OnClosing(e); Taskbar.Show(); }
public void DisconnectRemote() { remoteDesktop.Disconnect(); Taskbar.Show(); reconnectTimer.Stop(); recSW.Stop(); timer.Stop(); sw.Stop(); connectButton.BackColor = System.Drawing.Color.Green; connectButton.Text = "Connect"; avatarPictureBox.Show(); connectMessageLabel.Show(); meetingOngoinglabel.Text = "You Viewed " + sw.Elapsed.Hours + " h " + sw.Elapsed.Minutes + " m " + sw.Elapsed.Seconds + " seconds"; //progressBar.Hide(); livePictureBox.Hide(); timerLabel.Hide(); timeLabel.Hide(); fullScreenCheckBox.Show(); //hubConnection.Stop(); //hubConnection.Dispose(); }
private void connectButton_Click(object sender, EventArgs e) { //string host = "192.168.104.45"; if (remoteDesktop.IsConnected) { this.DisconnectRemote(); } else { try { string host = ReadTextFromFile(ConfigurationManager.AppSettings["HostIPLink"].ToString()); //string host = ConfigurationManager.AppSettings["host"].ToString(); //string host="192.168.104.45"; bool scale = !fullScreenCheckBox.Checked; remoteDesktop.Connect(host, 0, true, scale); //ConnectWithSignalIR(); if (remoteDesktop.IsConnected) { // Form1.FormBorderStyle = FormBorderStyle.FixedDialog; Taskbar.Hide(); //Form1 avatarPictureBox.Hide(); connectMessageLabel.Hide(); connectButton.BackColor = System.Drawing.Color.Red; connectButton.Text = "Disconnect"; meetingOngoinglabel.Show(); meetingOngoinglabel.Text = "Meeting Ongoing !!"; livePictureBox.Show(); wellcomePictureBox.Hide(); fullScreenCheckBox.Hide(); //progressBar.Show(); //progressBar.Style = ProgressBarStyle.Marquee; //progressBar.MarqueeAnimationSpeed = 30; //time count timer = new Timer(); timer.Interval = (1000); timer.Tick += new EventHandler(timer_Tick); sw = new Stopwatch(); timer.Start(); sw.Start(); } else { reconnectTimer.Stop(); reconnectTimer.Dispose(); recSW.Stop(); recSW.Reset(); MessageBox.Show("Incorrect Password"); this.Reconnect(); } //progressBar } catch (Exception ex) { reconnectTimer.Stop(); reconnectTimer.Dispose(); recSW.Stop(); recSW.Reset(); MessageBox.Show(this, "Unable to Join Meeting Because it has not Been Started", ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.Reconnect(); } } }
private void minimizeButton_Click(object sender, EventArgs e) { this.WindowState = FormWindowState.Minimized; Taskbar.Show(); }