private bool MakeControls(ReferenceItem referenceItem) { if (!referenceItem.HasParameters) { return(false); } var panel = new Panel(); panel.Style.Add("border", "none"); var literal = new Literal { Text = string.Format("<div style=\"margin-left:10px;margin-top:4px;font-weight:bold\">{0}</div><br/>", referenceItem.PrettyName) }; panel.ID = Control.GetUniqueID( string.Concat("params_", referenceItem.GetType().Name.ToLower(), "_", referenceItem.Name.ToLower(), "_")); panel.Controls.Add(literal); foreach (var pi in referenceItem.Parameters) { var i = new Inline(); var l = new Label { Header = pi.Title + ":" }; l.Style.Add("font-weight", "bold"); l.Style.Add("padding-top", "5px"); l.Style.Add("margin-right", "10px"); l.Style.Add("margin-left", "20px"); l.Style.Add("width", "100px"); l.Style.Add("text-align", "right"); l.Style.Add("float", "left"); var input = pi.MakeControl(); l.For = input.ID; i.Style.Add("display", "block"); i.Style.Add("margin-top", "5px"); if (input is ASR.Controls.DateTimePicker) { i.Style.Add("margin-bottom", "30px"); } else { i.Style.Add("margin-bottom", "20px"); } i.Value = input.ID; i.ID = Control.GetUniqueID("params_" + pi.Name + "_"); i.Controls.Add(l); i.Controls.Add(input); var lit = new Literal { Text = "<br/>" }; i.Controls.Add(lit); panel.Controls.Add(i); } ConfigSection.Controls.Add(panel); return(true); }
private void makeControls(ReferenceItem referenceItem) { if (!referenceItem.HasParameters) { return; } var panel = new Panel(); panel.Style.Add("border", "none"); panel.Style.Add("margin-bottom", "10px"); var literal = new Literal { Text = string.Format("<strong>{0}</strong><br/>", referenceItem.Name) }; panel.ID = Control.GetUniqueID( string.Concat("params_", referenceItem.GetType().Name.ToLower(), "_", referenceItem.Name.ToLower(), "_")); panel.Controls.Add(literal); foreach (var pi in referenceItem.Parameters) { var i = new Inline(); var l = new Label { Header = pi.Title + ":" }; l.Style.Add("font-weight", "bold"); l.Style.Add("margin-right", "10px"); l.Style.Add("margin-left", "20px"); l.Style.Add("width", "100px"); l.Style.Add("text-align", "right"); l.Style.Add("float", "left"); var input = pi.MakeControl(); l.For = input.ID; i.Style.Add("display", "block"); i.Style.Add("margin-top", "5px"); i.Value = input.ID; i.ID = Control.GetUniqueID("params_" + pi.Name + "_"); i.Controls.Add(l); i.Controls.Add(input); var lit = new Literal { Text = "<br/>" }; i.Controls.Add(lit); panel.Controls.Add(i); } this.ConfigSection.Controls.Add(panel); }