C# Класс YamuiFramework.HtmlRenderer.WinForms.HtmlContainer

Low level handling of Html Renderer logic, this class is used by HtmlParser, HtmlLabel, HtmlToolTip and HtmlRender.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
CreateKeyEevent YamuiFramework.HtmlRenderer.Core.Adapters.Entities.RKeyEvent
CreateMouseEvent RMouseEvent

Открытые методы

Метод Описание
Dispose ( ) : void
GetAttributeAt ( Point location, string attribute ) : string

Get attribute value of element at the given x,y location by given key.
If more than one element exist with the attribute at the location the inner most is returned.

GetElementRectangle ( string elementId ) : RectangleF?

Get the rectangle of html element as calculated by html layout.
Element if found by id (id attribute on the html element).
Note: to get the screen rectangle you need to adjust by the hosting control.

GetHtml ( HtmlGenerationStyle styleGen = HtmlGenerationStyle.Inline ) : string

Get html from the current DOM tree with style if requested.

GetLinkAt ( Point location ) : string

Get css link href at the given x,y location.

GetLinks ( ) : List>

Get all the links in the HTML with the element rectangle and href data.

HandleKeyDown ( Control parent, KeyEventArgs e ) : void

Handle key down event for selection and copy.

HandleMouseDoubleClick ( Control parent, MouseEventArgs e ) : void

Handle mouse double click to select word under the mouse.

HandleMouseDown ( Control parent, MouseEventArgs e ) : void

Handle mouse down to handle selection.

HandleMouseLeave ( Control parent ) : void

Handle mouse leave to handle hover cursor.

HandleMouseMove ( Control parent, MouseEventArgs e ) : void

Handle mouse move to handle hover cursor and text selection.

HandleMouseUp ( Control parent, MouseEventArgs e ) : void

Handle mouse up to handle selection and link click.

HtmlContainer ( ) : System

Init.

PerformLayout ( Graphics g ) : void

Measures the bounds of box and children, recursively.

PerformPaint ( Graphics g ) : void

Render the html using the given device.

SetHtml ( string htmlSource, YamuiFramework.HtmlRenderer.Core.Core.CssData baseCssData = null ) : void

Init with optional document and stylesheet.

Приватные методы

Метод Описание
CreateKeyEevent ( KeyEventArgs e ) : YamuiFramework.HtmlRenderer.Core.Adapters.Entities.RKeyEvent

Create HtmlRenderer key event from win forms key event.

CreateMouseEvent ( MouseEventArgs e ) : RMouseEvent

Create HtmlRenderer mouse event from win forms mouse event.

Описание методов

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

GetAttributeAt() публичный Метод

Get attribute value of element at the given x,y location by given key.
If more than one element exist with the attribute at the location the inner most is returned.
public GetAttributeAt ( Point location, string attribute ) : string
location Point the location to find the attribute at
attribute string the attribute key to get value by
Результат string

GetElementRectangle() публичный Метод

Get the rectangle of html element as calculated by html layout.
Element if found by id (id attribute on the html element).
Note: to get the screen rectangle you need to adjust by the hosting control.
public GetElementRectangle ( string elementId ) : RectangleF?
elementId string the id of the element to get its rectangle
Результат RectangleF?

GetHtml() публичный Метод

Get html from the current DOM tree with style if requested.
public GetHtml ( HtmlGenerationStyle styleGen = HtmlGenerationStyle.Inline ) : string
styleGen HtmlGenerationStyle Optional: controls the way styles are generated when html is generated (default: )
Результат string

GetLinkAt() публичный Метод

Get css link href at the given x,y location.
public GetLinkAt ( Point location ) : string
location Point the location to find the link at
Результат string

GetLinks() публичный Метод

Get all the links in the HTML with the element rectangle and href data.
public GetLinks ( ) : List>
Результат List>

HandleKeyDown() публичный Метод

Handle key down event for selection and copy.
public HandleKeyDown ( Control parent, KeyEventArgs e ) : void
parent System.Windows.Forms.Control the control hosting the html to invalidate
e System.Windows.Forms.KeyEventArgs the pressed key
Результат void

HandleMouseDoubleClick() публичный Метод

Handle mouse double click to select word under the mouse.
public HandleMouseDoubleClick ( Control parent, MouseEventArgs e ) : void
parent System.Windows.Forms.Control the control hosting the html to set cursor and invalidate
e MouseEventArgs mouse event args
Результат void

HandleMouseDown() публичный Метод

Handle mouse down to handle selection.
public HandleMouseDown ( Control parent, MouseEventArgs e ) : void
parent System.Windows.Forms.Control the control hosting the html to invalidate
e MouseEventArgs the mouse event args
Результат void

HandleMouseLeave() публичный Метод

Handle mouse leave to handle hover cursor.
public HandleMouseLeave ( Control parent ) : void
parent System.Windows.Forms.Control the control hosting the html to set cursor and invalidate
Результат void

HandleMouseMove() публичный Метод

Handle mouse move to handle hover cursor and text selection.
public HandleMouseMove ( Control parent, MouseEventArgs e ) : void
parent System.Windows.Forms.Control the control hosting the html to set cursor and invalidate
e MouseEventArgs the mouse event args
Результат void

HandleMouseUp() публичный Метод

Handle mouse up to handle selection and link click.
public HandleMouseUp ( Control parent, MouseEventArgs e ) : void
parent System.Windows.Forms.Control the control hosting the html to invalidate
e MouseEventArgs the mouse event args
Результат void

HtmlContainer() публичный Метод

Init.
public HtmlContainer ( ) : System
Результат System

PerformLayout() публичный Метод

Measures the bounds of box and children, recursively.
public PerformLayout ( Graphics g ) : void
g System.Drawing.Graphics Device context to draw
Результат void

PerformPaint() публичный Метод

Render the html using the given device.
public PerformPaint ( Graphics g ) : void
g System.Drawing.Graphics the device to use to render
Результат void

SetHtml() публичный Метод

Init with optional document and stylesheet.
public SetHtml ( string htmlSource, YamuiFramework.HtmlRenderer.Core.Core.CssData baseCssData = null ) : void
htmlSource string the html to init with, init empty if not given
baseCssData YamuiFramework.HtmlRenderer.Core.Core.CssData optional: the stylesheet to init with, init default if not given
Результат void