Exemplo n.º 1
0
        public void view_OnCreateControls(object sender, CreateControlsEventArgs e)
        {
            var factory = new ExternalVariableEditorFactory();

            foreach (var variable in e.Variables)
            {
                var value   = e.Values.Where(n => n.Key == variable.id).Select(m => m.Value).FirstOrDefault();
                var control = factory.CreateExternalVariableEditor(variable).GetEditor(value);

                if (variable.datatype == SimpleDatatypeEnumeration.boolean)
                {
                    view.AddControl(control);
                }
                else
                {
                    var label = new Label()
                    {
                        Text = String.Format("{0}", variable.comment)
                    };
                    label.AutoSize = true;
                    Controls.Add(label);

                    view.AddControlWithLabel(label, control);
                }

                Controls.Add(control);
            }
        }
Exemplo n.º 2
0
        public void view_OnCreateControls(object sender, CreateControlsEventArgs e)
        {
            var factory = new ExternalVariableEditorFactory();
            foreach (var variable in e.Variables)
            {
                var value = e.Values.Where(n => n.Key == variable.id).Select(m => m.Value).FirstOrDefault();
                var control = factory.CreateExternalVariableEditor(variable).GetEditor(value);

                if (variable.datatype == SimpleDatatypeEnumeration.boolean)
                {
                    view.AddControl(control);
                }
                else
                {
                    var label = new Label() { Text = String.Format("{0}", variable.comment) };
                    label.AutoSize = true;
                    Controls.Add(label);

                    view.AddControlWithLabel(label, control);
                }

                Controls.Add(control);
            }
        }