public static void StartArtItem(this MamlWriter writer, ArtItem artItem, int indentLevel) { //writer.StartMarkup(); //writer.WriteStartElement("nobr", String.Empty); //writer.WriteStartElement("artLink"); //writer.WriteAttributeString("target", artItem.Id); //writer.WriteEndElement(); //writer.WriteRaw(NonBlockingSpaceEntityName); writer.WriteStartElement("notLocalizable"); //notLocalizable writer.WriteAttributeString("address", writer.GetNextNobrAddress()); if (indentLevel > 0) { writer.WriteIndent(indentLevel); } // Write the inline-image... writer.WriteMediaLinkInline(artItem.Id); // Write a white space... //writer.WriteStartElement("phrase"); //phrase //writer.WriteRaw(NonBlockingSpaceEntityName); //writer.WriteEndElement(); //phrase }
public static void WriteArtItemWithTopicLink(this MamlWriter writer, ArtItem artItem, Topic topic, int indentLevel) { //writer.StartHtmlArtItem(artItem); //writer.WriteHtmlTopicLink(topic); //writer.EndHtmlArtItem(); writer.WriteStartElement("notLocalizable"); //notLocalizable writer.WriteAttributeString("address", writer.GetNextNobrAddress()); if (indentLevel > 0) { writer.WriteIndent(indentLevel); } // Write the inline-image... writer.WriteMediaLinkInline(artItem.Id); // Write a white space... //writer.WriteStartElement("phrase"); //phrase //writer.WriteRaw(NonBlockingSpaceEntityName); //writer.WriteEndElement(); //phrase // Write the line... writer.WriteLink(topic.Id, topic.LinkTitle); writer.WriteEndElement(); //notLocalizable }
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 WriteArtItemWithText(this MamlWriter writer, ArtItem artItem, string text) { //writer.StartHtmlArtItem(artItem); //writer.WriteString(text); //writer.EndHtmlArtItem(); writer.WriteStartElement("notLocalizable"); //notLocalizable writer.WriteAttributeString("address", writer.GetNextNobrAddress()); // Write the inline-image... writer.WriteMediaLinkInline(artItem.Id); // Write a white space... //writer.WriteStartElement("phrase"); //phrase //writer.WriteRaw(NonBlockingSpaceEntityName); //writer.WriteEndElement(); //phrase // Write the line... writer.WriteString(text); writer.WriteEndElement(); //notLocalizable }
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(); }