Пример #1
0
 public UserInput_Integer(UserInputTagData _Data)
 {
     InitializeComponent();
     Data = _Data;
     numericUpDown1.Value = (int)Data.Value;
     groupBox1.Text = Data.InputID;
     this.Tag = Data;
 }
Пример #2
0
 public UserInput_Boolean(UserInputTagData _Data)
 {
     InitializeComponent();
     Data = _Data;
     set = (bool)Data.Value;
     button1.Text = set ? "On" : "Off";
     groupBox1.Text = Data.InputID;
     this.Tag = Data;
 }
Пример #3
0
 public UserInput_String(UserInputTagData _Data)
 {
     InitializeComponent();
     Data = _Data;
     if(!string.IsNullOrEmpty(Data.Value as string))
     {
         richTextBox1.Text = (string)Data.Value;
     }
     groupBox1.Text = Data.InputID;
     this.Tag = Data;
 }
Пример #4
0
        void LoadUserInput(UserData data = null)
        {
            UserInput[] UserData = null;
            if (SelectedHandler != null)
                UserData = SelectedHandler.Command.UserData;
            userInputHeight = 0;
            this.Height = DefaultHeight;
            UserInputPanel.Controls.Clear();
            if (UserData == null || UserData == null || UserData.Length < 1)
            {
                this.Height = DefaultHeight;
                UserInputPanel.Visible = false;
                hasUserInput = false;
                return;
            }
            this.Height += 10;
            foreach (var u in UserData)
            {
                if(TypeForm.ContainsKey(u.InputType))
                {
                    var tagData = new UserInputTagData(u.InputType, u.ID);

                    if (data != null)
                    {
                        object value = data.GetValue<object>(u.ID, null);
                        if (value != null && value.GetType() == u.InputType)
                            tagData.Value = value;
                    }

                    Control c = (Control)Activator.CreateInstance(TypeForm[u.InputType], tagData);
                    c.Width = UserInputPanel.Width;
                    c.Parent = UserInputPanel;
                    c.Location = new Point(0, userInputHeight);

                    userInputHeight += c.Height;
                    UserInputPanel.Controls.Add(c);
                }
            }
            hasUserInput = true;
            UserInputPanel.Visible = true;
            UserInputPanel.Height = userInputHeight;
            this.Height += userInputHeight;
        }