천호석
2022-11-21 0ced3ee4e65354419392c757b9502d1670f8888c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Drawing;
using System.Windows.Forms;
 
namespace SHARP_CLAS_UI
{
    public partial class uc_Output_Vlaue : UserControl
    {
        public delegate void ClickEvent(object sender, EventArgs e);
        public bool status;
        public readonly string name;
        public readonly string description;
        public OutputAxis Axis { get; private set; }
        public int Row { get; private set; }
 
        public uc_Output_Vlaue(string name, string description, OutputAxis Axis, int Row, bool status = false)
        {
            InitializeComponent();
            this.name = name;
            this.description = description;
            lb_Name.Text = name;
            lb_Description.Text = description;
            this.Axis = Axis;
            this.Row = Row;
            this.status = status;
            lb_State.BackColor = status ? Color.Lime : Color.Green;
        }
 
        public void Change_Status(bool status)
        {
            this.status = status;
            lb_State.BackColor = status ? Color.Lime : Color.Green;
        }
 
        public void Add_Click_Event(ClickEvent clicked)
        {
            lb_State.Click += new EventHandler(clicked);
        }
    }
}