protected override void Write(XamlMarkdownWriter renderer, ListBlock listBlock) { renderer.WriteStartObject(typeof(List)); if (listBlock.IsOrdered) { renderer.WriteMember(List.MarkerStyleProperty, TextMarkerStyle.Decimal); if (listBlock.OrderedStart != null && (listBlock.DefaultOrderedStart != listBlock.OrderedStart)) { renderer.WriteMember(List.StartIndexProperty, listBlock.OrderedStart); } } else { renderer.WriteMember(List.MarkerStyleProperty, TextMarkerStyle.Disc); } renderer.WriteStartItems(nameof(List.ListItems)); foreach (var cur in listBlock) { renderer.WriteStartObject(typeof(ListItem)); renderer.WriteItems((ContainerBlock)cur); renderer.WriteEndObject(); } renderer.WriteEndItems(); renderer.WriteEndObject(); } // proc Write
} // func GetStyleKey protected override void Write(XamlMarkdownWriter renderer, HeadingBlock headingBlock) { renderer.WriteStartObject(typeof(Paragraph)); renderer.WriteResourceMember(null, GetStyleKey(headingBlock.Level)); renderer.WriteItems(headingBlock); renderer.WriteEndObject(); } // proc Write
protected override void Write(XamlMarkdownWriter renderer, CodeBlock obj) { renderer.WriteStartObject(typeof(Paragraph)); renderer.WriteResourceMember(null, MarkdownXamlStyle.CodeBlock); //if (obj is FencedCodeBlock f) // f.Info; renderer.WriteItems(obj, true); renderer.WriteEndObject(); } // proc Write
protected override void Write(XamlMarkdownWriter renderer, QuoteBlock block) { renderer.WriteStartObject(typeof(Section)); renderer.WriteResourceMember(null, MarkdownXamlStyle.QuoteBlock); renderer.WriteItems(block); renderer.WriteEndObject(); } // proc Write
protected override void Write(XamlMarkdownWriter renderer, ThematicBreakBlock obj) { renderer.WriteStartObject(typeof(Paragraph)); renderer.WriteResourceMember(null, MarkdownXamlStyle.ThematicBreak); renderer.WriteEndObject(); //var line = new System.Windows.Shapes.Line { X2 = 1 }; //line.SetResourceReference(FrameworkContentElement.StyleProperty, Styles.ThematicBreakStyleKey); //var paragraph = new Paragraph //{ // Inlines = { new InlineUIContainer(line) } //}; //renderer.WriteBlock(paragraph); } // proc Write
protected override void Write(XamlMarkdownWriter renderer, ParagraphBlock paragraph) { renderer.WriteStartObject(typeof(Paragraph)); renderer.WriteItems(paragraph); renderer.WriteEndObject(); } // proc Write