Exemple #1
0
        private void GetValues(Dictionary <string, string> dic, ExternalVariableHelper helper)
        {
            foreach (var control in Controls)
            {
                if (control is Panel)
                {
                    var    panel = (Panel)control;
                    string value = String.Empty;
                    foreach (var item in panel.Controls)
                    {
                        if (item is RadioButton)
                        {
                            var radio = (RadioButton)item;
                            if (radio.Checked)
                            {
                                value = String.Format("{0}", radio.Tag);
                                break;
                            }
                        }
                    }

                    //e.Values.Add(panel.Name, value);
                    dic.Add(panel.Name, value);
                }
                else if (control is CheckBox)
                {
                    var check = (CheckBox)control;
                    //e.Values.Add(check.Name, check.Checked.ToString().ToLower());

                    dic.Add(check.Name, check.Checked.ToString().ToLower());
                }
                else if (control is ComboBox)
                {
                    var value = helper.GetSelectItemValue((ComboBox)control);
                    //e.Values.Add(control.Name, value);

                    dic.Add(control.Name, value);
                }
                else if (!(control is Label))
                {
                    //e.Values.Add(control.Name, control.Text);
                    dic.Add(control.Name, control.Text);
                }
            }

            //e.Xml = helper.GetEvaluatedExternalVariables(e.Values, e.ExternalVariables);
        }
Exemple #2
0
        public void view_OnGetExternalVariables(object sender, ExternalVariableEventArgs e)
        {
            var helper = new ExternalVariableHelper();

            e.Values = new Dictionary <string, string>();
            foreach (var control in Controls)
            {
                if (control is Panel)
                {
                    var    panel = (Panel)control;
                    string value = String.Empty;
                    foreach (var item in panel.Controls)
                    {
                        if (item is RadioButton)
                        {
                            var radio = (RadioButton)item;
                            if (radio.Checked)
                            {
                                value = String.Format("{0}", radio.Tag);
                                break;
                            }
                        }
                    }
                    e.Values.Add(panel.Name, value);
                }
                else if (control is CheckBox)
                {
                    var check = (CheckBox)control;
                    e.Values.Add(check.Name, check.Checked.ToString().ToLower());
                }
                else if (control is ComboBox)
                {
                    var value = helper.GetSelectItemValue((ComboBox)control);
                    e.Values.Add(control.Name, value);
                }
                else if (!(control is Label))
                {
                    e.Values.Add(control.Name, control.Text);
                }
            }

            e.Xml = helper.GetEvaluatedExternalVariables(e.Values, e.ExternalVariables);
        }
        public void view_OnGetExternalVariables(object sender, ExternalVariableEventArgs e)
        {
            var helper = new ExternalVariableHelper();

            e.Values = new Dictionary<string, string>();
            foreach (var control in Controls)
            {
                if (control is Panel)
                {
                    var panel = (Panel)control;
                    string value = String.Empty;
                    foreach (var item in panel.Controls)
                    {
                        if (item is RadioButton)
                        {
                            var radio = (RadioButton)item;
                            if (radio.Checked)
                            {
                                value = String.Format("{0}", radio.Tag);
                                break;
                            }
                        }
                    }
                    e.Values.Add(panel.Name, value);
                }
                else if (control is CheckBox)
                {
                    var check = (CheckBox)control;
                    e.Values.Add(check.Name, check.Checked.ToString().ToLower());
                }
                else if (control is ComboBox)
                {
                    var value = helper.GetSelectItemValue((ComboBox)control);
                    e.Values.Add(control.Name, value);
                }
                else if (!(control is Label))
                {
                    e.Values.Add(control.Name, control.Text);
                }
            }

            e.Xml = helper.GetEvaluatedExternalVariables(e.Values, e.ExternalVariables);
        }
        private void GetValues(Dictionary<string, string> dic, ExternalVariableHelper helper)
        {
            foreach (var control in Controls)
            {
                if (control is Panel)
                {
                    var panel = (Panel)control;
                    string value = String.Empty;
                    foreach (var item in panel.Controls)
                    {
                        if (item is RadioButton)
                        {
                            var radio = (RadioButton)item;
                            if (radio.Checked)
                            {
                                value = String.Format("{0}", radio.Tag);
                                break;
                            }
                        }
                    }

                    //e.Values.Add(panel.Name, value);
                    dic.Add(panel.Name, value);
                }
                else if (control is CheckBox)
                {
                    var check = (CheckBox)control;
                    //e.Values.Add(check.Name, check.Checked.ToString().ToLower());

                    dic.Add(check.Name, check.Checked.ToString().ToLower());
                }
                else if (control is ComboBox)
                {
                    var value = helper.GetSelectItemValue((ComboBox)control);
                    //e.Values.Add(control.Name, value);

                    dic.Add(control.Name, value);
                }
                else if (!(control is Label))
                {
                    //e.Values.Add(control.Name, control.Text);
                    dic.Add(control.Name, control.Text);
                }
            }

            //e.Xml = helper.GetEvaluatedExternalVariables(e.Values, e.ExternalVariables);
        }