using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ProductionControl.UIExtend
{
    public partial class DefectCountOfSizeControl : UserControl
    {
        public DefectCountOfSizeControl()
        {
            InitializeComponent();
        }
  
        [Description("启用"), Category("自定义")]
        public bool Checked
        {
            get { return this.checkBox1.Checked; }
            set { this.checkBox1.Checked=value; }
        }


        [Description("标题"), Category("自定义")]
        public string Title
        {
            get { return this.checkBox1.Text; }
            set { this.checkBox1.Text = value; }
        }
        [Description("Code"), Category("自定义")]
        public string Code
        {
            get { return this.checkBox1.Tag==null?"":this.checkBox1.Tag.ToString(); }
            set { this.checkBox1.Tag = value; }
        }

        [Description("尺寸范围"), Category("自定义")]
        public decimal SizeValue
        {
            get { return  this.numSize.Value; }
            set { this.numSize.Value =  value; }
        }
        [Description("最大允许缺陷数量"), Category("自定义")]
        public decimal MaxDefectCount
        {
            get { return this.numMaxDefectCount.Value; }
            set { this.numMaxDefectCount.Value = value; }
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            this.numMaxDefectCount.Enabled = this.numSize.Enabled = this.Checked;
        }
    }
}
