Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
WpfExtensions.cs
1using System.Text;
2using System.Threading.Tasks;
3using System.Xml;
5
7{
11 public static class WpfExtensions
12 {
18 public static Task<string> GenerateXAML(this MarkdownDocument Document)
19 {
20 return Document.GenerateXAML(XML.WriterSettings(false, true));
21 }
22
29 public static async Task<string> GenerateXAML(this MarkdownDocument Document, XmlWriterSettings XmlSettings)
30 {
31 StringBuilder Output = new StringBuilder();
32 await Document.GenerateXAML(Output, XmlSettings);
33 return Output.ToString();
34 }
35
41 public static Task GenerateXAML(this MarkdownDocument Document, StringBuilder Output)
42 {
43 return Document.GenerateXAML(Output, XML.WriterSettings(false, true));
44 }
45
52 public static Task GenerateXAML(this MarkdownDocument Document, StringBuilder Output, XmlWriterSettings XmlSettings)
53 {
54 return Document.GenerateXAML(Output, XmlSettings, new XamlSettings());
55 }
56
64 public static async Task GenerateXAML(this MarkdownDocument Document, StringBuilder Output, XmlWriterSettings XmlSettings,
66 {
67 XmlSettings.ConformanceLevel = ConformanceLevel.Fragment;
68
69 using (WpfXamlRenderer Renderer = new WpfXamlRenderer(Output, XmlSettings, XamlSettings))
70 {
71 await Document.RenderDocument(Renderer);
72 }
73 }
74
81 public static async Task GenerateXAML(this MarkdownDocument Document, StringBuilder Output, XamlSettings XamlSettings)
82 {
83 XmlWriterSettings XmlSettings = XML.WriterSettings(false, true);
84 XmlSettings.ConformanceLevel = ConformanceLevel.Fragment;
85
86 using (WpfXamlRenderer Renderer = new WpfXamlRenderer(Output, XmlSettings, XamlSettings))
87 {
88 await Document.RenderDocument(Renderer);
89 }
90 }
91
98 public static async Task<string> GenerateXAML(this MarkdownDocument Document, XamlSettings XamlSettings)
99 {
100 StringBuilder Output = new StringBuilder();
101 await Document.GenerateXAML(Output, XamlSettings);
102 return Output.ToString();
103 }
104 }
105}
Contains a markdown document. This markdown document class supports original markdown,...
async Task RenderDocument(IRenderer Output)
Renders the document using provided output format.
Markdown rendering extensions for WPF XAML.
static Task GenerateXAML(this MarkdownDocument Document, StringBuilder Output, XmlWriterSettings XmlSettings)
Generates WPF XAML from the markdown text.
static async Task< string > GenerateXAML(this MarkdownDocument Document, XamlSettings XamlSettings)
Generates WPF XAML from the markdown text.
static Task GenerateXAML(this MarkdownDocument Document, StringBuilder Output)
Generates WPF XAML from the markdown text.
static async Task GenerateXAML(this MarkdownDocument Document, StringBuilder Output, XamlSettings XamlSettings)
Generates WPF XAML from the markdown text.
static async Task< string > GenerateXAML(this MarkdownDocument Document, XmlWriterSettings XmlSettings)
Generates WPF XAML from the markdown text.
static async Task GenerateXAML(this MarkdownDocument Document, StringBuilder Output, XmlWriterSettings XmlSettings, XamlSettings XamlSettings)
Generates WPF XAML from the markdown text.
static Task< string > GenerateXAML(this MarkdownDocument Document)
Generates WPF XAML from the markdown text.
Renders XAML (WPF flavour) from a Markdown document.
Contains settings that the XAML export uses to customize XAML output.
Definition: XamlSettings.cs:10
Helps with common XML-related tasks.
Definition: XML.cs:19
static XmlWriterSettings WriterSettings(bool Indent, bool OmitXmlDeclaration)
Gets an XML writer settings object.
Definition: XML.cs:1177