public void SetDataType(DataType2 dt, decimal value) { switch (dt) { case DataType2.Integer: numericUpDown.Minimum = int.MinValue; numericUpDown.Maximum = int.MaxValue; numericUpDown.Value = value; this.Text = dt.ToString(); break; case DataType2.Real: case DataType2.LineWeight: numericUpDown.Minimum = decimal.MinValue; numericUpDown.Maximum = decimal.MaxValue; numericUpDown.Value = value; this.Text = dt.ToString(); break; case DataType2.Angle: numericUpDown.Minimum = Convert.ToDecimal(0.0); numericUpDown.Maximum = Convert.ToDecimal(360.0); numericUpDown.Value = value; this.Text = dt.ToString(); break; case DataType2.ObliqueAngle: numericUpDown.Minimum = Convert.ToDecimal(-85.0); numericUpDown.Maximum = Convert.ToDecimal(85.0); numericUpDown.Value = value; this.Text = dt.ToString(); break; case DataType2.TrackSpacing: numericUpDown.Minimum = Convert.ToDecimal(0.75); numericUpDown.Maximum = Convert.ToDecimal(10.0); numericUpDown.Value = value; this.Text = dt.ToString(); break; } }
public void SetDataType(DataType2 dt2, bool value) { this.Text = dt2.ToString(); if (value) { rdTrue.Checked = true; } else { rdFalse.Checked = true; } }
private Func <string> GetEnumPicker(DataType2 dt2, Array values) { return(() => { var list = new List <string>(); foreach (object val in values) { list.Add(val.ToString()); } var item = Maestro.Editors.Common.GenericItemSelectionDialog.SelectItem(null, dt2.ToString(), list.ToArray()); if (item != null) { return $"'{item}'"; } return null; }); }