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 WriteNodes(this MamlWriter writer, Context context, IEnumerable <SimpleTypeStructureNode> children, int level) { foreach (var childEntry in children) { if (childEntry.NodeType == SimpleTypeStructureNodeType.NamedType) { continue; } writer.StartTableRow(); var isSingleRow = GetIsSingleRow(childEntry); if (isSingleRow) { writer.WriteSingleItemAndFacet(level, context.TopicManager, childEntry); } else { writer.WriteConstructorItemAndFacet(level, context.TopicManager, childEntry); } writer.StartTableRowEntry(); writer.WriteSummaryForObject(context, childEntry.Node); writer.EndTableRowEntry(); writer.EndTableRow(); if (!isSingleRow) { writer.WriteNodes(context, childEntry.Children, level + 1); } } }
private static void WriteConstraintRow(this MamlWriter writer, Context context, ArtItem artItem, string constrainedType, XmlSchemaIdentityConstraint constraint) { writer.StartTableRow(); writer.StartTableRowEntry(); writer.WriteArtItemInline(artItem); writer.EndTableRowEntry(); writer.StartTableRowEntry(); writer.WriteString(constrainedType); writer.EndTableRowEntry(); writer.StartTableRowEntry(); writer.WriteSummaryForObject(context, constraint); writer.EndTableRowEntry(); writer.StartTableRowEntry(); writer.WriteString(constraint.Selector.XPath); writer.EndTableRowEntry(); writer.StartTableRowEntry(); writer.WriteConstraintFieldList(constraint.Fields); writer.EndTableRowEntry(); writer.EndTableRow(); }
private static void WriteChildrenRows(this MamlWriter writer, Context context, IEnumerable <ChildEntry> childEntries, int level) { foreach (var childEntry in childEntries) { writer.StartTableRow(); writer.StartTableRowEntry(); writer.StartParagraph(); //writer.WriteHtmlIndent(level); writer.WriteName(childEntry, context.TopicManager, level); writer.EndParagraph(); writer.EndTableRowEntry(); writer.StartTableRowEntry(); writer.StartParagraph(); writer.WriteOccurrence(childEntry); writer.EndParagraph(); writer.EndTableRowEntry(); writer.StartTableRowEntry(); writer.StartParagraph(); writer.WriteDescription(childEntry, context); writer.EndParagraph(); writer.EndTableRowEntry(); writer.EndTableRow(); writer.WriteChildrenRows(context, childEntry.Children, level + 1); } }
public static void WriteChildrenTable(this MamlWriter writer, Context context, List <ChildEntry> childEntries) { if (childEntries == null || childEntries.Count == 0) { return; } SortAllAndChoiceChildren(childEntries); writer.StartTable(); writer.StartTableHeader(); writer.StartTableRow(); writer.WriteRowEntry("Name"); writer.WriteRowEntry("Occurrences"); writer.WriteRowEntry("Description"); writer.EndTableRow(); writer.EndTableHeader(); writer.WriteChildrenRows(context, childEntries, 0); writer.EndTable(); }
public static void WriteConstraintTable(this MamlWriter writer, Context context, XmlSchemaObjectCollection constraints) { if (constraints.Count == 0) { return; } writer.StartTable(); writer.StartTableHeader(); writer.StartTableRow(); writer.WriteRowEntry(String.Empty); writer.WriteRowEntry("Type"); writer.WriteRowEntry("Description"); writer.WriteRowEntry("Selector"); writer.WriteRowEntry("Fields"); writer.EndTableRow(); writer.EndTableHeader(); var rowBuilder = new ConstraintRowWriter(writer, context); rowBuilder.Traverse(constraints); writer.EndTable(); }
public static void WriteSimpleTypeStrucure(this MamlWriter writer, Context context, SimpleTypeStructureNode root) { if (root == null || root.Children.Count == 0) { return; } if (root.Children.Count == 1) { var node = root.Children[0]; var isSingleRow = SimpleTypeStructureNode.GetIsSingleRow(node); if (isSingleRow) { writer.StartParagraph(); writer.WriteSingle(context.TopicManager, node, 0); writer.EndParagraph(); return; } } writer.StartTable(); writer.StartTableHeader(); writer.StartTableRow(); writer.WriteRowEntry("Item"); //writer.WriteRowEntry("Facet Value"); writer.StartTableRowEntry(); writer.StartParagraph(); writer.WriteStartElement("notLocalizable"); //notLocalizable writer.WriteAttributeString("address", writer.GetNextNobrAddress()); writer.WriteString("Facet Value"); writer.WriteEndElement(); //notLocalizable writer.EndParagraph(); writer.EndTableRowEntry(); writer.WriteRowEntry("Description"); writer.EndTableRow(); writer.EndTableHeader(); writer.WriteNodes(context, root.Children, 0); writer.EndTable(); }
public static void WriteSimpleTypeStrucure(this MamlWriter writer, Context context, SimpleTypeStructureNode root) { if (root == null || root.Children.Count == 0) { return; } if (root.Children.Count == 1) { var node = root.Children[0]; var isSingleRow = GetIsSingleRow(node); if (isSingleRow) { writer.WriteSingle(context.TopicManager, node); return; } } writer.StartTable(); writer.StartTableHeader(); writer.StartTableRow(); writer.StartTableRowEntry(); writer.WriteString("Item"); writer.EndTableRowEntry(); writer.StartTableRowEntry(); writer.WriteString("Facet Value"); writer.EndTableRowEntry(); writer.StartTableRowEntry(); writer.WriteString("Description"); writer.EndTableRowEntry(); writer.EndTableRow(); writer.EndTableHeader(); writer.WriteNodes(context, root.Children, 0); writer.EndTable(); }
public static void WriteAttributeTable(this MamlWriter writer, Context context, AttributeEntries attributeEntries) { if (attributeEntries.Attributes.Count == 0 && attributeEntries.AnyAttribute == null) { return; } writer.StartTable(); writer.StartTableHeader(); writer.StartTableRow(); writer.WriteRowEntry("Name"); writer.WriteRowEntry("Type"); writer.WriteRowEntry("Required"); writer.WriteRowEntry("Description"); writer.EndTableRow(); writer.EndTableHeader(); var sortedAttributes = from a in attributeEntries.Attributes orderby a.QualifiedName.Name select a; foreach (var attribute in sortedAttributes) { writer.StartTableRow(); writer.StartTableRowEntry(); writer.StartParagraph(); writer.WriteAttributeTopicLink(context.TopicManager, attribute, false, 0); writer.EndParagraph(); writer.EndTableRowEntry(); writer.StartTableRowEntry(); writer.StartParagraph(); writer.WriteType(context, attribute.AttributeSchemaType); writer.EndParagraph(); writer.EndTableRowEntry(); writer.StartTableRowEntry(); writer.StartParagraph(); writer.WriteRequiredText(attribute.Use); writer.EndParagraph(); writer.EndTableRowEntry(); writer.StartTableRowEntry(); writer.StartParagraph(); writer.WriteSummaryForObject(context, attribute); writer.EndParagraph(); writer.EndTableRowEntry(); writer.EndTableRow(); } if (attributeEntries.AnyAttribute != null) { writer.StartTableRow(); writer.StartTableRowEntry(); writer.StartParagraph(); writer.WriteArtItemWithText(ArtItem.AnyAttribute, "Any"); writer.EndParagraph(); writer.EndTableRowEntry(); writer.StartTableRowEntry(); writer.WriteParagraph(String.Empty); writer.EndTableRowEntry(); writer.StartTableRowEntry(); writer.WriteParagraph(String.Empty); writer.EndTableRowEntry(); writer.StartTableRowEntry(); writer.StartParagraph(); writer.WriteSummaryForObject(context, attributeEntries.AnyAttribute); writer.EndParagraph(); writer.EndTableRowEntry(); writer.EndTableRow(); } var sortedExtensionAttributes = from a in attributeEntries.ExtensionAttributes orderby a.QualifiedName.Name select a; foreach (var attribute in sortedExtensionAttributes) { writer.StartTableRow(); writer.StartTableRowEntry(); writer.StartParagraph(); //writer.WriteHtmlIndent(1); writer.WriteAttributeTopicLink(context.TopicManager, attribute, true, 1); writer.EndParagraph(); writer.EndTableRowEntry(); writer.StartTableRowEntry(); writer.StartParagraph(); writer.WriteType(context, attribute.AttributeSchemaType); writer.EndParagraph(); writer.EndTableRowEntry(); writer.StartTableRowEntry(); writer.StartParagraph(); writer.WriteRequiredText(attribute.Use); writer.EndParagraph(); writer.EndTableRowEntry(); writer.StartTableRowEntry(); writer.StartParagraph(); writer.WriteSummaryForObject(context, attribute); writer.EndParagraph(); writer.EndTableRowEntry(); writer.EndTableRow(); } writer.EndTable(); }
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(); }