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; using PMSUI.Model; namespace PMSUI { public partial class StationUserControl : UserControl { public StationUserControl() { InitializeComponent(); } private int _id; private string name = ""; private string type = ""; private int status = 0; private int area = 0; public int ID { get { return _id; } set { _id = value; } } public string JobName { get { return name; } set { name = value; this.Invoke(new Action(() => { this.lbname.Text = name; })); } } public string Materials { get { return type; } set { type = value; //if (type == 0 || this.area != VariableClass.DischargeArea) //{ lbtype.Visible = false; } //else //{ // lbtype.Visible = true; //} this.Invoke(new Action(() => { this.lbtype.Text = type.ToString(); })); } } public int Status { get { return status; } set { status = value; if (!this.IsHandleCreated) { base.CreateHandle(); } this.Invoke(new Action(() => { lbstatus.Text = status == VariableClass.StationEmpty ? VariableClass.Empty : (status == VariableClass.StationFill ? VariableClass.Fill : VariableClass.Tasking); switch (status) { case 1: this.BackColor = Color.AntiqueWhite; break; case 2: this.BackColor = Color.Green; break; case 3: this.BackColor = Color.Yellow; break; default: this.BackColor = Color.Yellow; break; } })); } } } }