コード例 #1
0
        //private readonly RiserAddress _address;

        public FormTaskDataEditor(string number, string ntype, int factheight, int setpoint /*, RiserAddress addr*/)
        {
            InitializeComponent();
            TypeDataKeeper.LoadTypesData("wagtypes.xml");
            foreach (var item in TypeDataKeeper.GetWaggonTypeItems().OrderBy(item => int.Parse(item.NType)))
            {
                cbNtype.Items.Add(item);
            }
            if (!string.IsNullOrWhiteSpace(number))
            {
                tbNumber.Text = number;
                FindWaggon(tbNumber.Text);
            }
            if (!string.IsNullOrWhiteSpace(ntype))
            {
                cbNtype.Text = ntype;
                cbNtype_SelectionChangeCommitted(null, null);
            }
            if (factheight > 0)
            {
                tbFactHeight.Text = factheight.ToString("0");
            }
            if (setpoint > 0)
            {
                tbSetpoint.Text = setpoint.ToString("0");
                UpdateMinMax(tbSetpoint);
            }
            //_address = addr;
        }
コード例 #2
0
 public FormWaggonDataEditor(bool edit, string number, string ntype, int factlevel)
 {
     InitializeComponent();
     Text             = edit ? "Редактировать цистерну" : "Новая цистерна";
     tbNumber.Text    = number;
     tbNumber.Enabled = !edit;
     lbNumber.Enabled = !edit;
     foreach (var item in TypeDataKeeper.GetWaggonTypeItems()
              .OrderBy(item => int.Parse(item.NType)))
     {
         cbNtype.Items.Add(item);
     }
     cbNtype.Text      = ntype;
     tbFactHeight.Text = factlevel > 0 ? factlevel.ToString("0") : "";
 }