Show / Hide Table of Contents

Class HtmlToXamlConverter

A class that takes an HTML (Hypertext Markup Language) string and converts it into XAML (Extensible Application Markup Language).

Inheritance
object
HtmlToXamlConverter
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: MarkupConverter
Assembly: Aruba.Utilities.MarkupConverter.dll
Syntax
public static class HtmlToXamlConverter

Methods

View Source

AddNbspToEmptyParagraphs(HtmlDocument)

Adds non-breaking space to empty paragraphs in a provided html document.

Declaration
public static void AddNbspToEmptyParagraphs(HtmlDocument htmlDoc)
Parameters
Type Name Description
HtmlDocument htmlDoc

The html document.

View Source

AddNbspToEmptyParagraphs(string)

Adds non-breaking space to empty paragraphs

Declaration
public static string AddNbspToEmptyParagraphs(string value)
Parameters
Type Name Description
string value

Text containing empty paragraphs.

Returns
Type Description
string

Text with empty paragraphs filled with a non-breaking space.

View Source

ConvertHtmlToXaml(string, bool)

Converts an html string into xaml string.

Declaration
public static string ConvertHtmlToXaml(string htmlString, bool asFlowDocument)
Parameters
Type Name Description
string htmlString

Input html which may be badly formated xml.

bool asFlowDocument

true indicates that we need a FlowDocument as a root element; false means that Section or Span elements will be used depending on StartFragment/EndFragment comments locations.

Returns
Type Description
string

Well-formed xml representing XAML equivalent for the input html string.

View Source

FormatLineSpacing(HtmlDocument)

Formats line spacing for a provided html document.

Declaration
public static void FormatLineSpacing(HtmlDocument htmlDoc)
Parameters
Type Name Description
HtmlDocument htmlDoc

The html document.

View Source

GetAttribute(XmlElement, string)

Returns a value for an attribute by its name (ignoring casing)

Declaration
public static string GetAttribute(XmlElement element, string attributeName)
Parameters
Type Name Description
XmlElement element

XmlElement in which we are trying to find the specified attribute

string attributeName

String representing the attribute name to be searched for

Returns
Type Description
string

value of the attribute if found, null otherwise

View Source

NewLinesToParagraphs(string)

Converts newline characters to paragraph tags.

Declaration
public static string NewLinesToParagraphs(string value)
Parameters
Type Name Description
string value

Text containing newline characters.

Returns
Type Description
string

Text with newline characters replaced by html paragraph tags.

  • View Source
In this article
Back to top Generated by DocFX