Example #1
0
        public void buildControlsForAction( InputPlayback.Actions.Action action )
        {
            panelParameters.SuspendLayout();

            controlsForParameters.Clear();
            panelParameters.Controls.Clear();

            actionType = action.GetType();
            foreach ( Actions.ParameterContainer parameter in action.GetParameters() )
            {
                Label label = new Label();
                label.Text = parameter.Name;
                label.Anchor = AnchorStyles.Left;
                label.TextAlign = ContentAlignment.MiddleLeft;
                label.AutoSize = true;
                panelParameters.Controls.Add( label );

                Control control = GetControlForType( parameter.Type, parameter.Value );
                panelParameters.Controls.Add( control );

                controlsForParameters.Add( new Tuple<string, Control>( parameter.Name, control ) );
            }

            panelParameters.ResumeLayout();
        }
Example #2
0
        private List<Control> buildControlsForAction( InputPlayback.Actions.Action action )
        {
            List<Control> controls = new List<Control>();
            foreach (Tuple<string, object> parameter in action.GetParameters() )
            {
                Label label = new Label();
                label.Text = parameter.Item1;
                label.Anchor = AnchorStyles.Left;
                label.TextAlign = ContentAlignment.MiddleLeft;
                label.AutoSize = true;
                controls.Add( label );

                Control control = getControlForType( parameter.Item2.GetType() );
                controls.Add( control );
            }
            return controls;
        }