示例#1
0
        /// <summary>
        /// Cleans up when the main form closes.
        /// </summary>
        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            ConnectServerCTRL.Disconnect();

            if (WindowState == FormWindowState.Maximized)
            {
                Properties.Settings.Default.Location  = RestoreBounds.Location;
                Properties.Settings.Default.Size      = RestoreBounds.Size;
                Properties.Settings.Default.Maximized = true;
                Properties.Settings.Default.Minimized = false;
            }
            else if (WindowState == FormWindowState.Normal)
            {
                Properties.Settings.Default.Location  = Location;
                Properties.Settings.Default.Size      = Size;
                Properties.Settings.Default.Maximized = false;
                Properties.Settings.Default.Minimized = false;
            }
            else
            {
                Properties.Settings.Default.Location  = RestoreBounds.Location;
                Properties.Settings.Default.Size      = RestoreBounds.Size;
                Properties.Settings.Default.Maximized = false;
                Properties.Settings.Default.Minimized = true;
            }
            Properties.Settings.Default.Save();
        }
示例#2
0
 /// <summary>
 /// Connects to a server.
 /// </summary>
 private async void Server_ConnectMI_ClickAsync(object sender, EventArgs e)
 {
     try
     {
         await ConnectServerCTRL.Connect();
     }
     catch (Exception exception)
     {
         ClientUtils.HandleException(this.Text, exception);
     }
 }
示例#3
0
 /// <summary>
 /// Prompts the user to choose a server on another host.
 /// </summary>
 private void Server_DiscoverMI_Click(object sender, EventArgs e)
 {
     try
     {
         ConnectServerCTRL.Discover(null);
     }
     catch (Exception exception)
     {
         ClientUtils.HandleException(this.Text, exception);
     }
 }
示例#4
0
 /// <summary>
 /// Connects to a server.
 /// </summary>
 private void Server_ConnectMI_Click(object sender, EventArgs e)
 {
     try
     {
         ConnectServerCTRL.Connect();
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 /// <summary>
 /// Disconnects from the current session.
 /// </summary>
 private void Server_DisconnectMI_Click(object sender, EventArgs e)
 {
     try
     {
         ConnectServerCTRL.Disconnect();
         m_session      = null;
         m_subscription = null;
     }
     catch (Exception exception)
     {
         ClientUtils.HandleException(this.Text, exception);
     }
 }
示例#6
0
 /// <summary>
 /// Disconnects from the current session.
 /// </summary>
 private void Server_DisconnectMI_Click(object sender, EventArgs e)
 {
     try
     {
         ConnectServerCTRL.Disconnect();
         Server_ConnectMI.Enabled    = true;
         Server_DisconnectMI.Enabled = false;
     }
     catch (Exception exception)
     {
         ClientUtils.HandleException(this.Text, exception);
     }
 }
示例#7
0
 /// <summary>
 /// Cleans up when the main form closes.
 /// </summary>
 private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     ConnectServerCTRL.Disconnect();
 }