private void RenderInput(XmlNode element) { Assert.ArgumentNotNull(element, "element"); string attribute = XmlUtil.GetAttribute("section", element); if (!string.IsNullOrEmpty(attribute)) { Editor.Section sectionByName = this.Sections.GetSectionByName(attribute); if (sectionByName != null) { this.RenderFields(sectionByName); } } else { string str2 = XmlUtil.GetAttribute("id", element); if (!string.IsNullOrEmpty(str2)) { Editor.Field fieldByID = this.Sections.GetFieldByID(str2); if (fieldByID != null) { this.RenderInput(fieldByID); } } } }
private void RenderFields(Editor.Section section) { Assert.ArgumentNotNull(section, "section"); foreach (Editor.Field field in section.Fields) { this.RenderButtons(field); this.RenderLabel(field); this.RenderInput(field); } }
private void TrimFields(Editor.Section section) { for (int fieldIndex = 0; fieldIndex < section.Fields.Count; fieldIndex++) { if (!FieldIsVisible(section.Fields[fieldIndex])) { section.Fields.RemoveAt(fieldIndex); fieldIndex--; } } }
private void RenderSection(Editor.Section section) { Assert.ArgumentNotNull(section, "section"); Editor.Section section2 = this._currentSection; this._currentSection = section; bool renderCollapsedSections = UserOptions.ContentEditor.RenderCollapsedSections; this.Args.EditorFormatter.RenderSectionBegin(this.Args.Parent, section.ControlID, section.Name, section.DisplayName, section.Icon, section.IsSectionCollapsed, renderCollapsedSections); if (renderCollapsedSections) { this.RenderFields(section); } this.Args.EditorFormatter.RenderSectionEnd(this.Args.Parent, renderCollapsedSections, section.IsSectionCollapsed); this._currentSection = section2; }
public void RenderSection(Editor.Section section, Control parent, bool readOnly) { var sectionCollapsed = section.IsSectionCollapsed; var renderFields = !sectionCollapsed || UserOptions.ContentEditor.RenderCollapsedSections; RenderSectionBegin(parent, section.ControlID, section.Name, section.DisplayName, section.Icon, sectionCollapsed, renderFields); if (renderFields) { for (var index = 0; index < section.Fields.Count; ++index) { RenderField(parent, section.Fields[index], readOnly); } } RenderSectionEnd(parent, renderFields, sectionCollapsed); }
private void RenderSectionPanel(XmlNode element) { Assert.ArgumentNotNull(element, "element"); string attribute = XmlUtil.GetAttribute("name", element); if (!string.IsNullOrEmpty(attribute)) { Editor.Section sectionByName = this.Sections.GetSectionByName(attribute); if (sectionByName != null) { Editor.Section section2 = this._currentSection; this._currentSection = sectionByName; bool renderCollapsedSections = UserOptions.ContentEditor.RenderCollapsedSections; this.Args.EditorFormatter.RenderSectionBegin(this.Args.Parent, sectionByName.ControlID, sectionByName.Name, sectionByName.DisplayName, sectionByName.Icon, sectionByName.IsSectionCollapsed, renderCollapsedSections); this.RenderChildElements(element); this.Args.EditorFormatter.RenderSectionEnd(this.Args.Parent, renderCollapsedSections, sectionByName.IsSectionCollapsed); this._currentSection = section2; } } }
public void Process(GetContentEditorFieldsArgs args) { Assert.ArgumentNotNull(args, "args"); if (args.Sections == null || args.Sections.Count == 0) { return; } this.args = args; for (int sectionIndex = 0; sectionIndex < args.Sections.Count; sectionIndex++) { Editor.Section section = args.Sections[sectionIndex]; TrimFields(section); if (Settings.HidingEmptySections && section.Fields.Count == 0) { args.Sections.RemoveAt(sectionIndex); sectionIndex--; } } }