コード例 #1
0
        /// <summary>
        /// Gets the input values from the ParameterInfo array.
        /// </summary>
        /// <param name="pi">The  ParameterInfo array of the method being interrogated.</param>
        /// <param name="args">Any additional arguments.</param>
        private static void GetInputValues(IList <ParameterInfo> pi, IList <object> args)
        {
            string[] elements = null;

            for (int i = 0; i < pi.Count; i++)
            {
                if (pi[i].ParameterType.Name == "AutomationElement")
                {
                    ConvertInputParameters(pi, args, i, _focusedControl);
                    return;
                }

                /* check if enumeration, then build choices */
                if (pi[i].ParameterType.IsEnum)
                {
                    elements = Enum.GetNames(pi[i].ParameterType);
                }

                SetValueForm form = new SetValueForm
                {
                    ParamName    = pi[i].Name,
                    ParamChoices = elements,
                    ParamType    = pi[i].ParameterType
                };

                if (form.ShowDialog() == DialogResult.Cancel)
                {
                    return;
                }

                /* Handles a ToggleState */
                if (pi[i].ParameterType == typeof(ToggleState))
                {
                    ConvertInputParameters(pi, args, i, form.ReturnState);
                    return;
                }

                /* Strings and number values */
                ConvertInputParameters(pi, args, i, form.ReturnValue);
            }
        }
コード例 #2
0
 public windowParaVertex()
 {
     InitializeComponent();
     SetValueControl = new SetValueForm(GetValue);
 }
コード例 #3
0
ファイル: Form2.cs プロジェクト: bzy734084360/Study
 public Form2(string str, SetValueForm ss) : this()
 {
     textBox1.Text = str;
     st            = ss;
 }
コード例 #4
0
 public windowParaEdge()
 {
     InitializeComponent();
     SetValueControl = new SetValueForm(GetValueControl);
 }