C# Class YamuiFramework.HtmlRenderer.WinForms.HtmlContainer

Low level handling of Html Renderer logic, this class is used by HtmlParser, HtmlLabel, HtmlToolTip and HtmlRender.
Inheritance: IDisposable
ファイルを表示 Open project: jcaillon/3P Class Usage Examples

Private Properties

Property Type Description
CreateKeyEevent YamuiFramework.HtmlRenderer.Core.Adapters.Entities.RKeyEvent
CreateMouseEvent RMouseEvent

Public Methods

Method Description
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.

Private Methods

Method Description
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.

Method Details

Dispose() public method

public Dispose ( ) : void
return void

GetAttributeAt() public method

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
return string

GetElementRectangle() public method

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
return RectangleF?

GetHtml() public method

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: )
return string

GetLinkAt() public method

Get css link href at the given x,y location.
public GetLinkAt ( Point location ) : string
location Point the location to find the link at
return string

GetLinks() public method

Get all the links in the HTML with the element rectangle and href data.
public GetLinks ( ) : List>
return List>

HandleKeyDown() public method

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
return void

HandleMouseDoubleClick() public method

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
return void

HandleMouseDown() public method

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
return void

HandleMouseLeave() public method

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
return void

HandleMouseMove() public method

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
return void

HandleMouseUp() public method

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
return void

HtmlContainer() public method

Init.
public HtmlContainer ( ) : System
return System

PerformLayout() public method

Measures the bounds of box and children, recursively.
public PerformLayout ( Graphics g ) : void
g System.Drawing.Graphics Device context to draw
return void

PerformPaint() public method

Render the html using the given device.
public PerformPaint ( Graphics g ) : void
g System.Drawing.Graphics the device to use to render
return void

SetHtml() public method

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
return void