public PropertiesDialog(decimal _nodeLoss, NodeType type, bool _isStartElement) { NodeLoss = _nodeLoss; Type = type; IsStartElement = _isStartElement; Mode = PropsMode.Node; typeItems = NodeTypeRepositoryItem.GetStockItems(); typeItems.ForEach(x => typeItemsBindingList.Add(x)); InitializeComponent(); cbType.ValueMember = "Val"; cbType.DisplayMember = "Name"; cbType.DataSource = typeItemsBindingList; cbType.SelectedValue = Type; }
public PropertiesDialog(decimal _length, decimal _pipeLoss, decimal _c, decimal _diameter, decimal _qs, decimal _qe, int _sign, bool _reversed) { numOuts = new List <NumericUpDown>(); numIns = new List <NumericUpDown>(); Length = _length; PipeLoss = _pipeLoss; C = _c; Diameter = _diameter; Qs = _qs; Qe = _qe; Reversed = _reversed; Sign = _sign; Mode = PropsMode.Pipe; InitializeComponent(); }
private void button1_Click(object sender, EventArgs e) { Length = this.numLength.Value; PipeLoss = numPipeLoss.Value; Diameter = numDia.Value; C = numC.Value; Qs = numQs.Value; Qe = numQe.Value; Sign = rbPlus.Checked ? 1 : -1; NodeLoss = this.numLoss.Value; if (cbType.SelectedValue != null) { Type = (NodeType)(cbType.SelectedValue); } IsStartElement = chStart.Checked; Reversed = chReversed.Checked; Mode = PropsMode.Node; }