diff ServerMonitor/Controls/ServerSummaryControl.cs @ 0:3e1a2131f897

Initial commit. Ping check, scheduling, UI working. SSH check mostly working.
author Brad Greco <brad@bgreco.net>
date Mon, 31 Dec 2018 18:32:14 -0500
parents
children 3142e52cbe69
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ServerMonitor/Controls/ServerSummaryControl.cs	Mon Dec 31 18:32:14 2018 -0500
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace ServerMonitorApp
+{
+    public partial class ServerSummaryControl : UserControl
+    {
+        public new event EventHandler Click;
+
+        public Server Server { get; private set; }
+
+        public ServerSummaryControl(Server server)
+        {
+            InitializeComponent();
+
+            foreach (Control control in new Control[] { this, ServerPictureBox, ServerNameLabel })
+            {
+                control.Cursor = Cursors.Hand;
+                control.Click += Control_Click;
+            }
+            Server = server;
+            ServerNameLabel.Text = Server.Name;
+        }
+
+        private void Control_Click(object sender, EventArgs e)
+        {
+            Click?.Invoke(this, e);
+        }
+    }
+}