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; using System.Drawing.Drawing2D; using Mesnac.Controls.Base; namespace Mesnac.Controls.Sulf { public partial class Curing : SulfControl, IBaseControl { public Curing() : base() { InitializeComponent(); Init(); } private List _clickActionList = new List(); public List ClickActionList { get { return this._clickActionList; } set { this._clickActionList = value; } } private string _EquipName; public string EquipName { get { return this.label1.Text; } set { if (value != null) { _EquipName = value; this.label1.Text = value; } } } /// /// 指示灯状态 /// public Statelight.Statuses LightStatus { get { return this.statelight1.Status; } set { this.statelight1.Status = value; } } /// /// 指示灯状态属性 /// public string LightStatusName { get { return this.statelight1.StatusName; } set { this.statelight1.StatusName = value; } } private string _nodeName; public string NodeName { get { return _nodeName; } set { _nodeName = value; } } #region 总时间 private string _timeAllName; public string TimeAllName { get { return _timeAllName; } set { _timeAllName = value; } } private int _timeAll; public int TimeAll { get { return this._timeAll; } set { this._timeAll = value; } } #endregion #region 已用时间 private string _useTimeName; public string UseTimeName { get { return _useTimeName; } set { _useTimeName = value; } } private int _useTime; public int UseTime { get { return _useTime; } set { _useTime = value; SetProgress(); } } #endregion #region 物料信息 private string _paraName; public string ParaName { get { return _paraName; } set { _paraName = value; } } private string _para; public string Para { get { return this.label3.Text; } set { this.label3.Text = value; } } #endregion void SetProgress() { if (_timeAll != 0) { int progress = Convert.ToInt32(_timeAll / _timeAll * 100); this.panel3.Width = Convert.ToInt32(panel2.Width * (Convert.ToDecimal(progress) / 100)); string rate = progress.ToString() + "%"; RegionControl(this.label2, rate); } } private void RegionControl(Control control, string txt) { GraphicsPath gp = new GraphicsPath(); gp.AddString(txt, new FontFamily("宋体"), (int)FontStyle.Bold, 15, control.ClientRectangle, new StringFormat(StringFormatFlags.NoWrap)); control.Region = new Region(gp); control.ForeColor = Color.Blue; } #region IBaseControl 成员 public string ActionDataSource { get; set; } public object BindDataSource { get; set; } public DbOptionTypes DbOptionType { get; set; } public string InitDataSource { get; set; } public bool IsDbControl { get; set; } public bool IsValid { get; set; } public MCDataSource MCDataSource { get; set; } public string MCDataSourceID { get; set; } public bool MCEnabled { get; set; } public string MCKey { get; set; } public IBaseControl MCRoot { get; set; } public object MCValue { get; set; } public bool MCVisible { get; set; } #endregion } }