view ServerMonitor/Controls/ServerSummaryControl.cs @ 3:96f0b028176d

File check
author Brad Greco <brad@bgreco.net>
date Fri, 11 Jan 2019 22:34:18 -0500
parents 3e1a2131f897
children 3142e52cbe69
line wrap: on
line source

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);
        }
    }
}