diff ServerMonitor/Forms/CheckForm.cs @ 9:7127d5b5ac75

Code cleanup and comments
author Brad Greco <brad@bgreco.net>
date Mon, 08 Apr 2019 21:29:54 -0400
parents 052aa62cb42a
children d92176c5398a
line wrap: on
line diff
--- a/ServerMonitor/Forms/CheckForm.cs	Sat Mar 09 20:14:03 2019 -0500
+++ b/ServerMonitor/Forms/CheckForm.cs	Mon Apr 08 21:29:54 2019 -0400
@@ -1,19 +1,17 @@
-using ServerMonitorApp.Properties;
-using System;
+using System;
 using System.Collections.Generic;
 using System.ComponentModel;
-using System.Data;
 using System.Drawing;
 using System.Linq;
 using System.Text;
 using System.Threading;
 using System.Windows.Forms;
+using ServerMonitorApp.Properties;
 
 namespace ServerMonitorApp
 {
     public partial class CheckForm : Form
     {
-        //private static readonly Dictionary<Type, CheckInfo> checkInfo = new Dictionary<Type, CheckInfo>();
         private readonly List<CheckControl> checkControls = new List<CheckControl>();
         private bool helpShown;
         private CancellationTokenSource cancellationTokenSource;
@@ -86,16 +84,6 @@
             e.Value = Helpers.GetDisplayName((Type)e.ListItem);
         }
 
-        /*private void showGroupBox(GroupBox groupBox)
-        {
-
-        }*/
-
-        /*private Type GetCheckType()
-        {
-            return (Type)CheckTypeComboBox.SelectedItem;
-        }*/
-
         private void ShowCheckControl()
         {
             IEnumerable<CheckControl> checkControls = CheckSettingsPanel.Controls.OfType<CheckControl>();
@@ -115,8 +103,6 @@
             }
             if (checkControl != null)
             {
-                //CheckSettingsPanel.Height = checkControl.Height;
-                //Height = 230 + checkControl.Height;
                 checkControl.Show();
             }
         }
@@ -210,30 +196,6 @@
             localCancellationTokenSource = null;
         }
 
-        //private void RunButton_Click(object sender, EventArgs e)
-        //{
-        //    if (!Check.Server.SshClient.IsConnected)
-        //        Check.Server.SshClient.Connect();
-        //    using (Renci.SshNet.SshCommand command = Check.Server.SshClient.CreateCommand("ls"))
-        //    {
-        //        //token.Register(command.CancelAsync);
-        //        //command.BeginExecute(asyncResult =>
-        //        //{
-        //        //    string result = command.EndExecute(asyncResult);
-        //        //    //tcs.SetResult(new CheckResult(this, CheckStatus.Success, result));
-        //        //});
-        //        IAsyncResult iar = command.BeginExecute(z);
-        //        command.EndExecute(iar);
-        //        //string result = command.Execute();
-        //        //System.Console.Write(result);
-        //    }
-        //}
-
-        //private void z(IAsyncResult ar)
-        //{
-        //    throw new NotImplementedException();
-        //}
-
         private void CancelRunButton_Click(object sender, EventArgs e)
         {
             cancellationTokenSource.Cancel();
@@ -250,25 +212,11 @@
             if (result != null)
             {
                 ResultLabel.Text = result.Message;
-                //ResultLabel.ForeColor = result.CheckStatus == CheckStatus.Success ? Color.Green : Color.Red;
                 ResultIconPictureBox.Image = result.CheckStatus.GetImage();
                 ResultLabel.Visible = ResultIconPictureBox.Visible = true;
             }
         }
 
-        /*private class CheckInfo
-        {
-            public GroupBox GroupBox { get; private set; }
-
-            public Func<string> ValidateFunction { get; private set; }
-
-            public CheckInfo(GroupBox groupBox, Func<string> validateFunction)
-            {
-                GroupBox = groupBox;
-                ValidateFunction = validateFunction;
-            }
-        }*/
-
         private string BuildHelpText()
         {
             StringBuilder rtf = new StringBuilder(@"{\rtf1\ansi ");