internal EditWidgetParameterValue(InputParameterValue param, Project project)
        {
            InitializeComponent();

            EditingProject   = project;
            EditingParameter = param;

            ParamNameLabel.Text = EditingParameter.GetControllingParameter().ReadableName;

            if (param is InputParameterValueNumeric)
            {
                var pnum = param as InputParameterValueNumeric;

                ValueUpDown.Minimum = (decimal)pnum.ControllingParameter.MinimumValue;
                ValueUpDown.Maximum = (decimal)pnum.ControllingParameter.MaximumValue;
                ValueUpDown.Value   = (decimal)pnum.Value;

                InputValueDropDown.Visible = false;
            }
            else if (param is InputParameterValueEnumeration)
            {
                var penum = param as InputParameterValueEnumeration;

                foreach (var valid in penum.ControllingParameter.ValidValues)
                {
                    InputValueDropDown.Items.Add(valid);
                }


                InputValueDropDown.SelectedItem = penum.Key;

                ValueUpDown.Visible = false;
            }
        }
Exemplo n.º 2
0
        internal EditWidgetParameterValue(InputParameterValue param)
        {
            InitializeComponent();
            Parameter = param;

            ParamNameLabel.Text = Parameter.ControllingParameter.ReadableName;
            ValueUpDown.Minimum = (decimal)Parameter.ControllingParameter.MinimumValue;
            ValueUpDown.Maximum = (decimal)Parameter.ControllingParameter.MaximumValue;
            ValueUpDown.Value   = (decimal)Parameter.Value;
        }