Ejemplo n.º 1
0
        private void ShowConnectionStatsForm()
        {
            if (this.connectionStatsForm == null || this.connectionStatsForm.IsDisposed)
            {
                // If the form has been closed, or never shown before, we need all new stuff
                this.connectionStatsForm = new Form
                {
                    Width = 430,
                    Height = 180,
                    MaximizeBox = false,
                    MinimizeBox = false,
                    FormBorderStyle = FormBorderStyle.FixedDialog,
                    Text = Strings.LinkStats
                };
                // Change the connection stats control, so that when/if the connection stats form is showing,
                // there will be something to see
                this.connectionStatsForm.Controls.Clear();
                _connectionStats = new ConnectionStats(comPort);
                this.connectionStatsForm.Controls.Add(_connectionStats);
                this.connectionStatsForm.Width = _connectionStats.Width;
            }

            this.connectionStatsForm.Show();
            ThemeManager.ApplyThemeTo(this.connectionStatsForm);
        }
Ejemplo n.º 2
0
 private void ResetConnectionStats()
 {
     log.Info("Reset connection stats");
     // If the form has been closed, or never shown before, we need do nothing, as 
     // connection stats will be reset when shown
     if (this.connectionStatsForm != null && connectionStatsForm.Visible)
     {
         // else the form is already showing.  reset the stats
         this.connectionStatsForm.Controls.Clear();
         _connectionStats = new ConnectionStats(comPort);
         this.connectionStatsForm.Controls.Add(_connectionStats);
         ThemeManager.ApplyThemeTo(this.connectionStatsForm);
     }
 }