Méthode | Description | |
---|---|---|
ConvertHtmlToXaml ( string htmlString, bool asFlowDocument ) : string |
Converts an html string into xaml string.
|
|
GetAttribute ( |
Returns a value for an attribute by its name (ignoring casing)
|
Méthode | Description | |
---|---|---|
AddBlock ( |
Analyzes the given htmlElement expecting it to be converted into some of xaml Block elements and adds the converted block to the children collection of xamlParentElement. Analyzes the given XmlElement htmlElement, recognizes it as some HTML element and adds it as a child to a xamlParentElement. In some cases several following siblings of the given htmlElement will be consumed too (e.g. LIs encountered without wrapping UL/OL, which must be collected together and wrapped into one implicit List element).
|
|
AddBreak ( |
||
AddColumnInformation ( |
Processes the information about table columns - COLGROUP and COL html elements.
|
|
AddDataToTableCell ( |
adds table cell data to xamlTableCellElement
|
|
AddHyperlink ( |
||
AddImage ( |
||
AddImplicitParagraph ( |
Creates a Paragraph element and adds all nodes starting from htmlNode converted to appropriate Inlines.
|
|
AddInline ( |
||
AddList ( |
Converts Html ul or ol element into Xaml list element. During conversion if the ul/ol element has any children that are not li elements, they are ignored and not added to the list element
|
|
AddListItem ( |
Converts htmlLIElement into Xaml ListItem element, and appends it to the parent xamlListElement
|
|
AddOrphanListItems ( |
If li items are found without a parent ul/ol element in Html string, creates xamlListElement as their parent and adds them to it. If the previously added node to the same xamlParentElement was a List, adds the elements to that list. Otherwise, we create a new xamlListElement and add them to it. Elements are added as long as li elements appear sequentially. The first non-li or text node stops the addition.
|
|
AddParagraph ( |
Generates Paragraph element from P, H1-H7, Center etc.
|
|
AddSection ( |
Generates Section or Paragraph element from DIV depending whether it contains any block elements or not
|
|
AddSpanOrRun ( |
||
AddTable ( |
Converts htmlTableElement to a Xaml Table element. Adds tbody elements if they are missing so that a resulting Xaml Table element is properly formed.
|
|
AddTableCellsToTableRow ( |
Adds TableCell elements to xamlTableRowElement.
|
|
AddTableColumn ( |
Converts htmlColElement into Xaml TableColumn element, and appends it to the parent xamlTableColumnGroupElement
|
|
AddTableColumnGroup ( |
Converts htmlColgroupElement into Xaml TableColumnGroup element, and appends it to the parent xamlTableElement
|
|
AddTableRowsToTableBody ( |
Adds TableRow elements to xamlTableBodyElement. The rows are converted from Html tr elements that may be the children of an Html tbody element or an Html table element with tbody missing
|
|
AddTextRun ( |
||
AnalyzeTRStructure ( |
Performs a parsing pass over a tr element to read information about column width and rowspan attributes.
|
|
AnalyzeTableStructure ( |
Performs a parsing pass over a table to read information about column width and rowspan attributes. This information is used to determine the starting point of each column.
|
|
AnalyzeTbodyStructure ( |
Performs a parsing pass over a tbody to read information about column width and rowspan attributes. Information read about width attributes is stored in the reference ArrayList parameter columnStarts, which contains a list of all starting positions of all columns in the table, ordered from left to right. Row spans are taken into consideration when computing column starts
|
|
ApplyLocalProperties ( |
Analyzes local properties of Html element, converts them into Xaml equivalents, and applies them to xamlElement
|
|
ApplyPropertiesToTableCellElement ( |
Applies properties to xamlTableCellElement based on the html td element it is converted from. TODO: Use the processed properties for htmlChildNode instead of using the node itself |
|
CalculateColumnSpan ( int columnIndex, double columnWidth, |
Calculates column span based the column width and the widths of all other columns. Returns an integer representing the column span
|
|
ClearActiveRowSpans ( |
Used for clearing activeRowSpans array in the beginning/end of each tbody
|
|
ComposeThicknessProperty ( |
||
DefineInlineFragmentParent ( |
||
ExtractInlineFragment ( |
||
GetCellFromSingleCellTable ( |
||
GetColorValue ( string colorValue ) : string | ||
GetColumnWidth ( |
||
GetCssAttribute ( string cssStyle, string attributeName ) : string |
Extracts a value of css attribute from css style definition.
|
|
GetElementProperties ( |
Analyzes the tag of the htmlElement and infers its associated formatted properties. After that parses style attribute and adds all inline css styles. The resulting style attributes are collected in output parameter localProperties.
|
|
GetNextColumnIndex ( int columnIndex, double columnWidth, |
Gets index at which a column should be inseerted into the columnStarts ArrayList. This is decided by the value columnStart. The columnStarts ArrayList is ordered in ascending order. Returns an integer representing the index at which the column should be inserted
|
|
GetNextColumnStart ( |
Calculates width of next TD element based on starting position of current element and it's width, which is calculated byt he function
|
|
GetRowSpan ( |
Gets row span attribute from htmlTDElement. Returns an integer representing the value of the rowspan attribute. Default value if attribute is not specified or if it is invalid is 1
|
|
InitializeActiveRowSpans ( |
Used for initializing activeRowSpans array in the before adding rows to tbody element
|
|
SetPropertyValue ( |
||
TryGetLengthValue ( string lengthAsString, double &length ) : bool |
Converts a length value from string representation to a double.
|
|
UnQuote ( string value ) : string |
Returns string extracted from quotation marks
|
|
VerifyColumnStartsAscendingOrder ( |
Verifies that values in columnStart, which represent starting coordinates of all columns, are arranged in ascending order
|
public static ConvertHtmlToXaml ( string htmlString, bool asFlowDocument ) : string | ||
htmlString | string | /// Input html which may be badly formated xml. /// |
asFlowDocument | bool | /// true indicates that we need a FlowDocument as a root element; /// false means that Section or Span elements will be used /// dependeing on StartFragment/EndFragment comments locations. /// |
Résultat | string |
public static GetAttribute ( |
||
element | /// XmlElement in which we are trying to find the specified attribute /// | |
attributeName | string | /// String representing the attribute name to be searched for /// |
Résultat | string |