public static ControlInfo CreateDefaultSaveConfigUI(PropertyCollection props)
        {
            PanelControlInfo configUI = new PanelControlInfo();

            foreach (Property property in props)
            {
                PropertyControlInfo propertyControlInfo = PropertyControlInfo.CreateFor(property);

                foreach (Property controlProperty in propertyControlInfo.ControlProperties)
                {
                    if (0 == string.Compare(controlProperty.Name, ControlInfoPropertyNames.DisplayName.ToString(), StringComparison.InvariantCulture))
                    {
                        controlProperty.Value = property.Name;
                    }
                    else if (0 == string.Compare(controlProperty.Name, ControlInfoPropertyNames.ShowResetButton.ToString(), StringComparison.InvariantCulture))
                    {
                        controlProperty.Value = false;
                    }
                }

                configUI.AddChildControl(propertyControlInfo);
            }

            return(configUI);
        }
示例#2
0
        public static ControlInfo CreateDefaultConfigUI(IEnumerable <Property> props)
        {
            PanelControlInfo configUI = new PanelControlInfo();

            foreach (Property property in props)
            {
                PropertyControlInfo propertyControlInfo = PropertyControlInfo.CreateFor(property);
                propertyControlInfo.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = property.Name;
                configUI.AddChildControl(propertyControlInfo);
            }

            return(configUI);
        }
示例#3
0
        public PanelControl(PanelControlInfo panelInfo)
        {
            SuspendLayout();

            DoubleBuffered = true;

            int tabIndex = 0;

            foreach (ControlInfo controlInfo in panelInfo.ChildControls)
            {
                Control childControl = controlInfo.CreateWinFormsControl();
                childControl.TabIndex = tabIndex;
                ++tabIndex;
                this.controls.Add(childControl);
            }

            Controls.AddRange(this.controls.ToArray());

            ResumeLayout(false);
        }