C# Class Yuhan.WPF.XamlToHtmlParser.HtmlFromXamlConverter

HtmlToXamlConverter is a static class that takes an HTML string and converts it into XAML
显示文件 Open project: hansuky/Yuhan

Public Methods

Method Description
ConvertXamlToHtml ( string xamlString ) : string
ConvertXamlToHtml ( string xamlString, bool asFlowDocument ) : string

Main entry point for Xaml-to-Html converter. Converts a xaml string into html string.

Private Methods

Method Description
AddComplexProperty ( XmlTextReader xamlReader, StringBuilder inlineStyle ) : void

Conberts an element notation of complex property into

ParseXamlColor ( string color ) : string
ParseXamlThickness ( string thickness ) : string
ReadNextToken ( XmlReader xamlReader ) : bool

Reads several items from xamlReader skipping all non-significant stuff.

WriteElement ( XmlTextReader xamlReader, XmlTextWriter htmlWriter, StringBuilder inlineStyle ) : void

Converts a xaml element into an appropriate html element.

WriteElementContent ( XmlTextReader xamlReader, XmlTextWriter htmlWriter, StringBuilder inlineStyle ) : void

Reads a content of current xaml element, converts it

WriteFlowDocument ( XmlTextReader xamlReader, XmlTextWriter htmlWriter ) : bool

Processes a root level element of XAML (normally it's FlowDocument element).

WriteFormattingProperties ( XmlTextReader xamlReader, XmlTextWriter htmlWriter, StringBuilder inlineStyle ) : void

Reads attributes of the current xaml element and converts them into appropriate html attributes or css styles.

Method Details

ConvertXamlToHtml() public static method

public static ConvertXamlToHtml ( string xamlString ) : string
xamlString string
return string

ConvertXamlToHtml() public static method

Main entry point for Xaml-to-Html converter. Converts a xaml string into html string.
public static ConvertXamlToHtml ( string xamlString, bool asFlowDocument ) : string
xamlString string /// Xaml strinng to convert. ///
asFlowDocument bool
return string