private void AddNormalConfigPanel(PlaceHolder placeHolder, Configuration config) { Panel panel = CreateNewConfigPanel(config); AdminAdvanced_Components_Common_HelpIcon helpIcon = LoadControl("../Components/Common/HelpIcon.ascx") as AdminAdvanced_Components_Common_HelpIcon; helpIcon.ID = config.Name + "Help"; helpIcon.ConfigName = config.Name; panel.Controls.Add(helpIcon); panel.Controls.Add(ConfigurationControlBuilder.CreateLabel( config.Descriptions[0].DisplayName, "Label")); switch (config.ConfigType) { case Configuration.ConfigurationType.DropDown: if (!ConfigurationControlBuilder.IsSpecialType(config.Name)) { panel.Controls.Add(CreateDropDownList(config)); } else { panel.Controls.Add(ConfigurationControlBuilder.GetControl(config, CurrentStore)); } placeHolder.Controls.Add(panel); break; case Configuration.ConfigurationType.TextBox: panel.Controls.Add(ConfigurationControlBuilder.CreateTextBox(config, CurrentStore)); panel.Controls.Add(ConfigurationControlBuilder.CreateValidatorPanel(config)); placeHolder.Controls.Add(panel); break; case Configuration.ConfigurationType.RadioButton: panel.Controls.Add(ConfigurationControlBuilder.CreateRadioButtonList(config, CurrentStore)); placeHolder.Controls.Add(panel); break; case Configuration.ConfigurationType.Upload: TextBox textBoxUploadControl = ConfigurationControlBuilder.CreateTextBox(config, CurrentStore, 210); panel.Controls.Add(textBoxUploadControl); panel.ID = config.Name + "UploadPanel"; placeHolder.Controls.Add(panel); CreateUploadPanel(config); break; } if (config.ChildConfigurations.Count > 0) { foreach (Configuration childConfig in config.ChildConfigurations) { placeHolder.Controls.Add(CreateChildPanel(config, childConfig)); } } }
private Panel CreateChildPanel(Configuration parentConfig, Configuration childConfig) { Panel childPanel = new Panel(); childPanel.ID = childConfig.Name + "Panel"; childPanel.CssClass = "ConfigRow"; AdminAdvanced_Components_Common_HelpIcon helpIcon = LoadControl("../Components/Common/HelpIcon.ascx") as AdminAdvanced_Components_Common_HelpIcon; helpIcon.ID = childConfig.Name + "Help"; helpIcon.ConfigName = childConfig.Name; childPanel.Controls.Add(helpIcon); childPanel.Controls.Add( ConfigurationControlBuilder.CreateLabel( childConfig.Descriptions[0].DisplayName, "BulletLabel")); if (ConfigurationControlBuilder.IsSpecialType(childConfig.Name)) { childPanel.Controls.Add( ConfigurationControlBuilder.GetControl(childConfig, CurrentStore)); } else { switch (childConfig.ConfigType) { case Configuration.ConfigurationType.DropDown: childPanel.Controls.Add(CreateDropDownList(childConfig)); break; case Configuration.ConfigurationType.TextBox: childPanel.Controls.Add( ConfigurationControlBuilder.CreateTextBox(childConfig, CurrentStore)); childPanel.Controls.Add(ConfigurationControlBuilder.CreateValidatorPanel(childConfig)); break; } } childPanel.Visible = ConvertUtilities.ToBoolean(parentConfig.Values[0].ItemValue); return(childPanel); }