/// <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); } }
public windowParaVertex() { InitializeComponent(); SetValueControl = new SetValueForm(GetValue); }
public Form2(string str, SetValueForm ss) : this() { textBox1.Text = str; st = ss; }
public windowParaEdge() { InitializeComponent(); SetValueControl = new SetValueForm(GetValueControl); }