using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Drawing;
|
using System.Data;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using System.Windows.Forms;
|
|
namespace SA_LTT_UI.Screen
|
{
|
public delegate void ClickEvent(object sender, EventArgs e);
|
|
public partial class IoBar : UserControl
|
{
|
private int _number;
|
private string _description;
|
private bool _status;
|
|
public bool Status
|
{
|
get
|
{
|
return _status;
|
}
|
|
set
|
{
|
_status = value;
|
lb_State.BackColor = _status ? Color.Lime : Color.Green;
|
}
|
}
|
|
public IoBar(int number, string description)
|
{
|
InitializeComponent();
|
|
_number = number;
|
_description = description;
|
|
lb_State.Tag = _number;
|
lb_Number.Text = $"{_number}";
|
lb_Description.Text = description;
|
}
|
|
public void AddClickEvent(ClickEvent clicked)
|
{
|
lb_State.Click += new EventHandler(clicked);
|
}
|
}
|
}
|