C# 클래스 YamuiFramework.HtmlRenderer.WinForms.HtmlPanel

Provides HTML rendering using the text property.
WinForms control that will render html content in it's client rectangle.
If AutoScroll is true and the layout of the html resulted in its content beyond the client bounds of the panel it will show scrollbars (horizontal/vertical) allowing to scroll the content.
If AutoScroll is false html content outside the client bounds will be clipped.
The control will handle mouse and keyboard events on it to support html text selection, copy-paste and mouse clicks.

The major differential to use HtmlPanel or HtmlLabel is size and scrollbars.
If the size of the control depends on the html content the HtmlLabel should be used.
If the size is set by some kind of layout then HtmlPanel is more suitable, also shows scrollbars if the html contents is larger than the control client rectangle.

AutoScroll:

Allows showing scrollbars if html content is placed outside the visible boundaries of the panel.

LinkClicked event:

Raised when the user clicks on a link in the html.
Allows canceling the execution of the link.

StylesheetLoad event:

Raised when a stylesheet is about to be loaded by file path or URI by link element.
This event allows to provide the stylesheet manually or provide new source (file or uri) to load from.
If no alternative data is provided the original source will be used.

ImageLoad event:

Raised when an image is about to be loaded by file path or URI.
This event allows to provide the image manually, if not handled the image will be loaded from file or download from URI.

RenderError event:

Raised when an error occurred during html rendering.

상속: System.Windows.Forms.ScrollableControl
파일 보기 프로젝트 열기: jcaillon/3P

보호된 프로퍼티들

프로퍼티 타입 설명
_baseCssData YamuiFramework.HtmlRenderer.Core.Core.CssData
_baseRawCssData string
_borderStyle BorderStyle
_htmlContainer HtmlContainer
_lastScrollOffset Point
_text string
_textRenderingHint TextRenderingHint
_useSystemCursors bool

Private Properties

프로퍼티 타입 설명
OnBoxClicked void
OnImageLoad void
OnLinkClicked void
OnRefresh void
OnRenderError void
OnScrollChange void
OnStylesheetLoad void
WndProc void
YamuiThemeManagerOnOnCssChanged void

공개 메소드들

메소드 설명
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 ( ) : string

Get html from the current DOM tree with inline style.

HtmlPanel ( ) : System

Creates a new HtmlPanel and sets a basic css for it's styling.

ScrollToElement ( string elementId ) : void

Adjust the scrollbar of the panel on html element by the given id.
The top of the html element rectangle will be at the top of the panel, if there is not enough height to scroll to the top the scroll will be at maximum.

보호된 메소드들

메소드 설명
Dispose ( bool disposing ) : void

Release the html container resources.

InvokeMouseMove ( ) : void

call mouse move to handle paint after scroll or html change affecting mouse cursor.

IsInputKey ( Keys keyData ) : bool

Used to add arrow keys to the handled keys in OnKeyDown.

OnBorderStyleChanged ( EventArgs e ) : void

Raises the BorderStyleChanged event.

OnBoxClicked ( YamuiFramework.HtmlRenderer.Core.Core.Entities.BoxClickedEventArgs e ) : void

Propagate the BoxClicked event from root container.

OnClick ( EventArgs e ) : void

Set focus on the control for keyboard scrollbars handling.

OnImageLoad ( YamuiFramework.HtmlRenderer.Core.Core.Entities.HtmlImageLoadEventArgs e ) : void

Propagate the image load event from root container.

OnKeyDown ( KeyEventArgs e ) : void

Handle key down event for selection, copy and scrollbars handling.

OnLayout ( System.Windows.Forms.LayoutEventArgs levent ) : void

Perform the layout of the html in the control.

OnLinkClicked ( YamuiFramework.HtmlRenderer.Core.Core.Entities.HtmlLinkClickedEventArgs e ) : void

Propagate the LinkClicked event from root container.

OnMouseDoubleClick ( MouseEventArgs e ) : void

Handle mouse double click to select word under the mouse.

OnMouseDown ( MouseEventArgs e ) : void

Handle mouse down to handle selection.

OnMouseLeave ( EventArgs e ) : void

Handle mouse leave to handle cursor change.

OnMouseMove ( MouseEventArgs e ) : void

Handle mouse move to handle hover cursor and text selection.

OnMouseUp ( MouseEventArgs e ) : void

Handle mouse up to handle selection and link click.

OnPaint ( PaintEventArgs e ) : void

Perform paint of the html in the control.

OnRefresh ( HtmlRefreshEventArgs e ) : void

Handle html renderer invalidate and re-layout as requested.

OnRenderError ( YamuiFramework.HtmlRenderer.Core.Core.Entities.HtmlRenderErrorEventArgs e ) : void

Propagate the Render Error event from root container.

OnScrollChange ( YamuiFramework.HtmlRenderer.Core.Core.Entities.HtmlScrollEventArgs e ) : void

On html renderer scroll request adjust the scrolling of the panel to the requested location.

OnStylesheetLoad ( YamuiFramework.HtmlRenderer.Core.Core.Entities.HtmlStylesheetLoadEventArgs e ) : void

Propagate the stylesheet load event from root container.

PerformHtmlLayout ( ) : void

Perform html container layout by the current panel client size.

UpdateScroll ( Point location ) : void

Adjust the scrolling of the panel to the requested location.

비공개 메소드들

메소드 설명
OnBoxClicked ( object sender, YamuiFramework.HtmlRenderer.Core.Core.Entities.BoxClickedEventArgs e ) : void
OnImageLoad ( object sender, YamuiFramework.HtmlRenderer.Core.Core.Entities.HtmlImageLoadEventArgs e ) : void
OnLinkClicked ( object sender, YamuiFramework.HtmlRenderer.Core.Core.Entities.HtmlLinkClickedEventArgs e ) : void
OnRefresh ( object sender, HtmlRefreshEventArgs e ) : void
OnRenderError ( object sender, YamuiFramework.HtmlRenderer.Core.Core.Entities.HtmlRenderErrorEventArgs e ) : void
OnScrollChange ( object sender, YamuiFramework.HtmlRenderer.Core.Core.Entities.HtmlScrollEventArgs e ) : void
OnStylesheetLoad ( object sender, YamuiFramework.HtmlRenderer.Core.Core.Entities.HtmlStylesheetLoadEventArgs e ) : void
WndProc ( Message &m ) : void
YamuiThemeManagerOnOnCssChanged ( ) : void

메소드 상세

Dispose() 보호된 메소드

Release the html container resources.
protected Dispose ( bool disposing ) : void
disposing bool
리턴 void

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 inline style.
public GetHtml ( ) : string
리턴 string

HtmlPanel() 공개 메소드

Creates a new HtmlPanel and sets a basic css for it's styling.
public HtmlPanel ( ) : System
리턴 System

InvokeMouseMove() 보호된 메소드

call mouse move to handle paint after scroll or html change affecting mouse cursor.
protected InvokeMouseMove ( ) : void
리턴 void

IsInputKey() 보호된 메소드

Used to add arrow keys to the handled keys in OnKeyDown.
protected IsInputKey ( Keys keyData ) : bool
keyData Keys
리턴 bool

OnBorderStyleChanged() 보호된 메소드

Raises the BorderStyleChanged event.
protected OnBorderStyleChanged ( EventArgs e ) : void
e System.EventArgs
리턴 void

OnBoxClicked() 보호된 메소드

Propagate the BoxClicked event from root container.
protected OnBoxClicked ( YamuiFramework.HtmlRenderer.Core.Core.Entities.BoxClickedEventArgs e ) : void
e YamuiFramework.HtmlRenderer.Core.Core.Entities.BoxClickedEventArgs
리턴 void

OnClick() 보호된 메소드

Set focus on the control for keyboard scrollbars handling.
protected OnClick ( EventArgs e ) : void
e System.EventArgs
리턴 void

OnImageLoad() 보호된 메소드

Propagate the image load event from root container.
protected OnImageLoad ( YamuiFramework.HtmlRenderer.Core.Core.Entities.HtmlImageLoadEventArgs e ) : void
e YamuiFramework.HtmlRenderer.Core.Core.Entities.HtmlImageLoadEventArgs
리턴 void

OnKeyDown() 보호된 메소드

Handle key down event for selection, copy and scrollbars handling.
protected OnKeyDown ( KeyEventArgs e ) : void
e System.Windows.Forms.KeyEventArgs
리턴 void

OnLayout() 보호된 메소드

Perform the layout of the html in the control.
protected OnLayout ( System.Windows.Forms.LayoutEventArgs levent ) : void
levent System.Windows.Forms.LayoutEventArgs
리턴 void

OnLinkClicked() 보호된 메소드

Propagate the LinkClicked event from root container.
protected OnLinkClicked ( YamuiFramework.HtmlRenderer.Core.Core.Entities.HtmlLinkClickedEventArgs e ) : void
e YamuiFramework.HtmlRenderer.Core.Core.Entities.HtmlLinkClickedEventArgs
리턴 void

OnMouseDoubleClick() 보호된 메소드

Handle mouse double click to select word under the mouse.
protected OnMouseDoubleClick ( MouseEventArgs e ) : void
e MouseEventArgs
리턴 void

OnMouseDown() 보호된 메소드

Handle mouse down to handle selection.
protected OnMouseDown ( MouseEventArgs e ) : void
e MouseEventArgs
리턴 void

OnMouseLeave() 보호된 메소드

Handle mouse leave to handle cursor change.
protected OnMouseLeave ( EventArgs e ) : void
e System.EventArgs
리턴 void

OnMouseMove() 보호된 메소드

Handle mouse move to handle hover cursor and text selection.
protected OnMouseMove ( MouseEventArgs e ) : void
e MouseEventArgs
리턴 void

OnMouseUp() 보호된 메소드

Handle mouse up to handle selection and link click.
protected OnMouseUp ( MouseEventArgs e ) : void
e MouseEventArgs
리턴 void

OnPaint() 보호된 메소드

Perform paint of the html in the control.
protected OnPaint ( PaintEventArgs e ) : void
e PaintEventArgs
리턴 void

OnRefresh() 보호된 메소드

Handle html renderer invalidate and re-layout as requested.
protected OnRefresh ( HtmlRefreshEventArgs e ) : void
e HtmlRefreshEventArgs
리턴 void

OnRenderError() 보호된 메소드

Propagate the Render Error event from root container.
protected OnRenderError ( YamuiFramework.HtmlRenderer.Core.Core.Entities.HtmlRenderErrorEventArgs e ) : void
e YamuiFramework.HtmlRenderer.Core.Core.Entities.HtmlRenderErrorEventArgs
리턴 void

OnScrollChange() 보호된 메소드

On html renderer scroll request adjust the scrolling of the panel to the requested location.
protected OnScrollChange ( YamuiFramework.HtmlRenderer.Core.Core.Entities.HtmlScrollEventArgs e ) : void
e YamuiFramework.HtmlRenderer.Core.Core.Entities.HtmlScrollEventArgs
리턴 void

OnStylesheetLoad() 보호된 메소드

Propagate the stylesheet load event from root container.
protected OnStylesheetLoad ( YamuiFramework.HtmlRenderer.Core.Core.Entities.HtmlStylesheetLoadEventArgs e ) : void
e YamuiFramework.HtmlRenderer.Core.Core.Entities.HtmlStylesheetLoadEventArgs
리턴 void

PerformHtmlLayout() 보호된 메소드

Perform html container layout by the current panel client size.
protected PerformHtmlLayout ( ) : void
리턴 void

ScrollToElement() 공개 메소드

Adjust the scrollbar of the panel on html element by the given id.
The top of the html element rectangle will be at the top of the panel, if there is not enough height to scroll to the top the scroll will be at maximum.
public ScrollToElement ( string elementId ) : void
elementId string the id of the element to scroll to
리턴 void

UpdateScroll() 보호된 메소드

Adjust the scrolling of the panel to the requested location.
protected UpdateScroll ( Point location ) : void
location Point the location to adjust the scroll to
리턴 void

프로퍼티 상세

_baseCssData 보호되어 있는 프로퍼티

the base stylesheet data used in the control
protected CssData,YamuiFramework.HtmlRenderer.Core.Core _baseCssData
리턴 YamuiFramework.HtmlRenderer.Core.Core.CssData

_baseRawCssData 보호되어 있는 프로퍼티

the raw base stylesheet data used in the control
protected string _baseRawCssData
리턴 string

_borderStyle 보호되어 있는 프로퍼티

The current border style of the control
protected BorderStyle _borderStyle
리턴 BorderStyle

_htmlContainer 보호되어 있는 프로퍼티

Underline html container instance.
protected HtmlContainer,YamuiFramework.HtmlRenderer.WinForms _htmlContainer
리턴 HtmlContainer

_lastScrollOffset 보호되어 있는 프로퍼티

The last position of the scrollbars to know if it has changed to update mouse
protected Point _lastScrollOffset
리턴 Point

_text 보호되어 있는 프로퍼티

the current html text set in the control
protected string _text
리턴 string

_textRenderingHint 보호되어 있는 프로퍼티

The text rendering hint to be used for text rendering.
protected TextRenderingHint _textRenderingHint
리턴 TextRenderingHint

_useSystemCursors 보호되어 있는 프로퍼티

If to use cursors defined by the operating system or .NET cursors
protected bool _useSystemCursors
리턴 bool