Inheritance: System.EventArgs
Esempio 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);
            }
        }
        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 labelId = new Label() { Text = String.Format("{0}", variable.id) };
                    var labelComment = new Label() { Text = String.Format("{0}", variable.comment) };

                    labelId.AutoSize = true;
                    labelComment.AutoSize = true;

                    view.AddControlWithLabel(new[] { labelId, labelComment }, control);
                }

                Controls.Add(control);
            }
        }
        private void ExternalVariableWindow_Shown(object sender, EventArgs e)
        {
            var args = new CreateControlsEventArgs();

            args.Variables = mainWindow.ExternalVariables;
            args.Values    = mainWindow.ExternalVariablesValues ?? new Dictionary <string, string>();

            this.OnCreateControls(this, args);
            if (args.Result)
            {
                Dialog.Error(args.ErrorMessage);
                this.Close();
            }
        }
Esempio n. 4
0
        private void ExternalVariableWindow_Shown(object sender, EventArgs e)
        {
            var args = new CreateControlsEventArgs();
            args.Variables = mainWindow.ExternalVariables;
            args.Values = mainWindow.ExternalVariablesValues ?? new Dictionary<string, string>();

            this.OnCreateControls(this, args);
            if (args.Result)
            {
                Dialog.Error(args.ErrorMessage);
                this.Close();
            }
        }