public static void WriteUsagesSection(this MamlWriter writer, Context context, IEnumerable <XmlSchemaObject> usages) { // Test for empty list... IList <ListItem> listItems = ListItemBuilder.Build(context, usages); if (listItems == null || listItems.Count == 0) { return; } writer.StartSection("Usages", "usages"); writer.StartParagraph(); writer.WriteList(context, listItems); writer.EndParagraph(); writer.StartParagraph(); if (context.MoveToTopLink && listItems.Count > 15) { // Create a link to the introduction, it is the top... writer.WriteLink("#introduction", "Top"); } writer.EndParagraph(); writer.EndSection(); }
public static void WriteSyntaxSection(this MamlWriter writer, Context context, XmlSchemaObject obj) { if (!context.Configuration.DocumentSyntax) { return; } string sourceCodeAbridged = context.SourceCodeManager.GetSourceCodeAbridged(obj); StringBuilder builder = new StringBuilder(sourceCodeAbridged); builder.Replace("xmlns=\"http://www.w3.org/2001/XMLSchema\"", String.Empty); builder.Replace("xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"", String.Empty); builder.Replace("xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"", String.Empty); writer.StartSection("Syntax", "syntax"); writer.WriteCode(builder.ToString(), "xml"); writer.StartParagraph(); if (context.MoveToTopLink) { // Create a link to the introduction, it is the top... writer.WriteLink("#introduction", "Top"); } writer.EndParagraph(); writer.EndSection(); }
public static void WriteTypeSection(this MamlWriter writer, Context context, XmlSchemaElement element) { var isSimpleType = element.ElementSchemaType is XmlSchemaSimpleType; if (isSimpleType) { return; } // Test for empty contents... writer.StartFragment(); writer.WriteTypeName(context.TopicManager, element.ElementSchemaType); writer.EndFragment(); if (String.IsNullOrEmpty(writer.Framement)) { return; } writer.StartSection("Type", "type"); writer.StartParagraph(); writer.WriteTypeName(context.TopicManager, element.ElementSchemaType); writer.EndParagraph(); writer.EndSection(); }
public static void WriteConstraintsSection(this MamlWriter writer, Context context, XmlSchemaObjectCollection constraints) { if (!context.Configuration.DocumentConstraints) { return; } writer.StartSection("Constraints", "constraints"); writer.WriteConstraintTable(context, constraints); writer.EndSection(); }
public static void WriteTypeSection(this MamlWriter writer, Context context, XmlSchemaElement element) { var isSimpleType = element.ElementSchemaType is XmlSchemaSimpleType; if (isSimpleType) { return; } writer.StartSection("Type", "type"); writer.WriteTypeName(context.TopicManager, element.ElementSchemaType); writer.EndSection(); }
public static void WriteSyntaxSection(this MamlWriter writer, Context context, XmlSchemaObject obj) { if (!context.Configuration.DocumentSyntax) { return; } var sourceCodeAbridged = context.SourceCodeManager.GetSourceCodeAbridged(obj); writer.StartSection("Syntax", "syntax"); writer.WriteCode(sourceCodeAbridged, "xml"); writer.EndSection(); }
private static void WriteJumpTableSection(this MamlWriter writer, ICollection <ListItem> listItems, string title, string address) { if (listItems.Count == 0) { return; } writer.StartSection(title, address); writer.StartTable(); writer.StartTableHeader(); writer.StartTableRow(); writer.StartTableRowEntry(); writer.EndTableRowEntry(); writer.StartTableRowEntry(); writer.WriteString("Element"); writer.EndTableRowEntry(); writer.StartTableRowEntry(); writer.WriteString("Description"); writer.EndTableRowEntry(); writer.EndTableRow(); writer.EndTableHeader(); foreach (var listItem in listItems) { writer.StartTableRow(); writer.StartTableRowEntry(); writer.WriteArtItemInline(listItem.ArtItem); writer.EndTableRowEntry(); writer.StartTableRowEntry(); writer.WriteTopicLink(listItem.Topic); writer.EndTableRowEntry(); writer.StartTableRowEntry(); writer.WriteRaw(listItem.SummaryMarkup); writer.EndTableRowEntry(); writer.EndTableRow(); } writer.EndTable(); writer.EndSection(); }
private static void WriteSection(this MamlWriter writer, string title, string address, XmlNode sectionNode) { var contentNode = sectionNode.ChildNodes[0]; var sectionsNode = sectionNode.ChildNodes.Count <= 1 ? null : sectionNode.ChildNodes[1]; writer.StartSection(title, address); writer.WriteRawContent(contentNode); if (sectionsNode != null) { writer.WriteRawContent(sectionsNode); } writer.EndSection(); }
public static void WriteBaseTypeSection(this MamlWriter writer, Context context, XmlSchemaComplexType complexType) { // Test for empty contents... writer.StartFragment(); writer.WriteTypeName(context.TopicManager, complexType.BaseXmlSchemaType); writer.EndFragment(); if (String.IsNullOrEmpty(writer.Framement)) { return; } writer.StartSection("Base Type", "baseType"); writer.StartParagraph(); writer.WriteTypeName(context.TopicManager, complexType.BaseXmlSchemaType); writer.EndParagraph(); writer.EndSection(); }
public static void WriteAttributesSection(this MamlWriter writer, Context context, AttributeEntries attributeEntries) { if (attributeEntries.Attributes.Count == 0 && attributeEntries.AnyAttribute == null) { return; } writer.StartSection("Attributes", "attributes"); writer.WriteAttributeTable(context, attributeEntries); writer.StartParagraph(); if (context.MoveToTopLink) { // Create a link to the introduction, it is the top... writer.WriteLink("#introduction", "Top"); } writer.EndParagraph(); writer.EndSection(); }
public static void WriteChildrenSection(this MamlWriter writer, Context context, List <ChildEntry> children) { if (children == null || children.Count == 0) { return; } writer.StartSection("Children", "children"); writer.WriteChildrenTable(context, children); writer.StartParagraph(); if (context.MoveToTopLink) { // Create a link to the introduction, it is the top... writer.WriteLink("#introduction", "Top"); } writer.EndParagraph(); writer.EndSection(); }
public static void WriteContentTypeSection(this MamlWriter writer, Context context, SimpleTypeStructureNode rootNode) { writer.StartSection("Content Type", "contentType"); writer.WriteSimpleTypeStrucure(context, rootNode); writer.EndSection(); }
public static void WriteParentsSection(this MamlWriter writer, Context context, IEnumerable <XmlSchemaObject> parents) { writer.StartSection("Parents", "parents"); writer.WriteList(context, parents); writer.EndSection(); }
public static void WriteAttributesSection(this MamlWriter writer, Context context, AttributeEntries attributeEntries) { writer.StartSection("Attributes", "attributes"); writer.WriteAttributeTable(context, attributeEntries); writer.EndSection(); }
public static void WriteChildrenSection(this MamlWriter writer, Context context, List <ChildEntry> children) { writer.StartSection("Children", "children"); writer.WriteChildrenTable(context, children); writer.EndSection(); }
public static void WriteUsagesSection(this MamlWriter writer, Context context, IEnumerable <XmlSchemaObject> usages) { writer.StartSection("Usages", "usages"); writer.WriteList(context, usages); writer.EndSection(); }
private static void WriteJumpTableSection(this MamlWriter writer, Context context, ICollection <ListItem> listItems, string title, string address) { if (listItems.Count == 0) { return; } writer.StartSection(title, address); writer.StartTable(); writer.StartTableHeader(); writer.StartTableRow(); //writer.WriteRowEntry(String.Empty); writer.StartTableRowEntry(); writer.StartParagraph(); writer.WriteToken("iconColumn"); writer.EndParagraph(); writer.EndTableRowEntry(); if (title.EndsWith("s", StringComparison.Ordinal)) { if (title.IndexOf(' ') < 0) // if it is a single word... { writer.WriteRowEntry(title.Remove(title.Length - 1)); } else { // Write non-breaking title text... writer.StartTableRowEntry(); writer.StartParagraph(); writer.WriteStartElement("notLocalizable"); //notLocalizable writer.WriteAttributeString("address", writer.GetNextNobrAddress()); writer.WriteString(title.Remove(title.Length - 1)); writer.WriteEndElement(); //notLocalizable writer.EndParagraph(); writer.EndTableRowEntry(); } } else { writer.WriteRowEntry("Element"); } writer.WriteRowEntry("Description"); writer.EndTableRow(); writer.EndTableHeader(); foreach (var listItem in listItems) { writer.StartTableRow(); writer.StartTableRowEntry(); writer.StartParagraph(); writer.WriteArtItemInline(listItem.ArtItem); writer.EndParagraph(); writer.EndTableRowEntry(); writer.StartTableRowEntry(); writer.StartParagraph(); writer.WriteTopicLink(listItem.Topic); writer.EndParagraph(); writer.EndTableRowEntry(); writer.StartTableRowEntry(); writer.StartParagraph(); writer.WriteRaw(listItem.SummaryMarkup); writer.EndParagraph(); writer.EndTableRowEntry(); writer.EndTableRow(); } writer.EndTable(); writer.StartParagraph(); if (context.MoveToTopLink) { // Create a link to the introduction, it is the top... writer.WriteLink("#introduction", "Top"); } writer.EndParagraph(); writer.EndSection(); }
public static void WriteBaseTypeSection(this MamlWriter writer, Context context, XmlSchemaComplexType complexType) { writer.StartSection("Base Type", "baseType"); writer.WriteTypeName(context.TopicManager, complexType.BaseXmlSchemaType); writer.EndSection(); }