private static void WriteSingle(this MamlWriter writer, TopicManager topicManager, SimpleTypeStructureNode node) { switch (node.NodeType) { case SimpleTypeStructureNodeType.Any: writer.WriteString("Any"); break; case SimpleTypeStructureNodeType.Mixed: writer.WriteString("Mixed"); break; case SimpleTypeStructureNodeType.NamedType: writer.WriteTypeName(topicManager, (XmlSchemaType)node.Node); break; case SimpleTypeStructureNodeType.List: writer.StartHtmlArtItem(ArtItem.List); writer.WriteTypeNamesMarkup(topicManager, node.Children); writer.EndHtmlArtItem(); break; case SimpleTypeStructureNodeType.Union: writer.StartHtmlArtItem(ArtItem.Union); writer.WriteTypeNamesMarkup(topicManager, node.Children); writer.EndHtmlArtItem(); break; default: throw ExceptionBuilder.UnhandledCaseLabel(node.NodeType); } }
private static void WriteConstructor(this MamlWriter writer, int level, TopicManager topicManager, SimpleTypeStructureNode node, ArtItem constructionArtItem, string constructName) { writer.StartTableRowEntry(); writer.WriteHtmlIndent(level); writer.StartHtmlArtItem(constructionArtItem); if (ContainsNamedTypes(node.Children)) { writer.WriteTypeNamesMarkup(topicManager, node.Children); } else { writer.WriteString(constructName); } writer.EndHtmlArtItem(); writer.EndTableRowEntry(); writer.StartTableRowEntry(); writer.EndTableRowEntry(); }
protected override void Visit(XmlSchemaSimpleTypeUnion union) { foreach (var baseMemberType in union.BaseMemberTypes) { if (!baseMemberType.QualifiedName.IsEmpty) { continue; } _writer.WriteHtmlArtItemWithText(ArtItem.Union, "Union"); return; } _writer.StartHtmlArtItem(ArtItem.Union); var isFirst = true; foreach (var baseMemberType in union.BaseMemberTypes) { if (isFirst) { _writer.WriteString(", "); isFirst = false; } var topic = _context.TopicManager.GetTopic(baseMemberType); if (topic != null) { _writer.WriteHtmlTopicLink(topic); } else { _writer.WriteString(baseMemberType.QualifiedName.Name); } } _writer.EndHtmlArtItem(); }
public static void WriteHtmlArtItemWithTopicLink(this MamlWriter writer, ArtItem artItem, Topic topic) { writer.StartHtmlArtItem(artItem); writer.WriteHtmlTopicLink(topic); writer.EndHtmlArtItem(); }
public static void WriteHtmlArtItemWithText(this MamlWriter writer, ArtItem artItem, string text) { writer.StartHtmlArtItem(artItem); writer.WriteString(text); writer.EndHtmlArtItem(); }