Méthode | Description | |
---|---|---|
ConvertHtmlToXaml ( string htmlString, bool asFlowDocument ) : string |
Converts an html string into xaml string.
|
|
GetAttribute ( XmlElement element, string attributeName ) : string |
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 ( ArrayList activeRowSpans ) : void |
Used for clearing activeRowSpans array in the beginning/end of each tbody
|
|
ComposeThicknessProperty ( XmlElement xamlElement, string propertyName, string left, string right, string top, string bottom ) : void | ||
DefineInlineFragmentParent ( XmlComment htmlComment, XmlElement xamlParentElement ) : void | ||
ExtractInlineFragment ( XmlElement xamlFlowDocumentElement ) : XmlElement | ||
GetCellFromSingleCellTable ( XmlElement htmlTableElement ) : XmlElement | ||
GetColorValue ( string colorValue ) : string | ||
GetColumnWidth ( XmlElement htmlTDElement ) : double | ||
GetCssAttribute ( string cssStyle, string attributeName ) : string |
Extracts a value of css attribute from css style definition.
|
|
GetElementProperties ( XmlElement htmlElement, Hashtable inheritedProperties, Hashtable &localProperties, CssStylesheet stylesheet, List |
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, ArrayList columnStarts, ArrayList activeRowSpans ) : int |
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 ( XmlElement htmlTDElement, double columnStart ) : double |
Calculates width of next TD element based on starting position of current element and it's width, which is calculated byt he function
|
|
GetRowSpan ( XmlElement htmlTDElement ) : int |
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 ( ArrayList activeRowSpans, int count ) : void |
Used for initializing activeRowSpans array in the before adding rows to tbody element
|
|
SetPropertyValue ( XmlElement xamlElement, DependencyProperty property, string stringValue ) : void | ||
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 ( ArrayList columnStarts ) : void |
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 ( XmlElement element, string attributeName ) : string | ||
element | XmlElement | /// 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 |