Class InputHTML
Class which is between the control and the HTMLParser.
Inheritance
Inherited Members
Namespace: Syncfusion.Windows.Forms.HTMLUI
Assembly: Syncfusion.HTMLUI.Windows.dll
Syntax
public class InputHTML : IInputHTML, IDisposable, ICloneable
Constructors
InputHTML(FormatManager)
Initializes a new instance of the InputHTML class
Declaration
protected InputHTML(FormatManager manager)
Parameters
| Type | Name | Description |
|---|---|---|
| FormatManager | manager | FormatManager instance |
InputHTML(Stream, FormatManager)
Initializes a new instance of the InputHTML class. Requires the stream of the document.
Declaration
public InputHTML(Stream stream, FormatManager manager)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | stream | Source stream of the data. |
| FormatManager | manager | Format manager object. |
InputHTML(Stream, FormatManager, XmlDocument)
Initializes a new instance of the InputHTML class. Requires the stream of the document.
Declaration
public InputHTML(Stream stream, FormatManager manager, XmlDocument output)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | stream | Source stream of the data. |
| FormatManager | manager | Format manager object. |
| System.Xml.XmlDocument | output | XML document of the HTML document. |
InputHTML(String, FormatManager)
Initializes a new instance of the InputHTML class
Declaration
public InputHTML(string filename, FormatManager manager)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filename | string filename |
| FormatManager | manager | FormatManager instance |
InputHTML(String, FormatManager, XmlDocument)
Initializes a new instance of the InputHTML class
Declaration
public InputHTML(string filename, FormatManager manager, XmlDocument output)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filename | Path to the source of the HTML data. |
| FormatManager | manager | Format manager object. |
| System.Xml.XmlDocument | output | XML document which represents the HTML data. |
InputHTML(Uri, FormatManager)
Initializes a new instance of the InputHTML class
Declaration
public InputHTML(Uri uri, FormatManager manager)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | uri | Unique Resource identifier (URI) of the HTML document. |
| FormatManager | manager | Format manager object. |
InputHTML(Uri, FormatManager, XmlDocument)
Initializes a new instance of the InputHTML class. Requires URI to file.
Declaration
public InputHTML(Uri uri, FormatManager manager, XmlDocument output)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | uri | Unique Resource identifier (URI) of the HTML document. |
| FormatManager | manager | Format manager object. |
| System.Xml.XmlDocument | output | XML storage of the HTML data. |
Properties
AutoScrollMinSize
Gets or sets the virtual size of the document.
Declaration
public Size AutoScrollMinSize { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Size |
AutoScrollPosition
Gets or sets the scroll offset position.
Declaration
public Point AutoScrollPosition { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Point |
ClientHeight
Gets or sets the client height of the document.
Declaration
protected int ClientHeight { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
ClientRectangle
Gets or sets the client rectangle for the document.
Declaration
protected Rectangle ClientRectangle { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Rectangle |
ClientSize
Gets or sets the client size of the document.
Declaration
public Size ClientSize { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Size |
ClientWidth
Gets or sets the client width of the document.
Declaration
protected int ClientWidth { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
CompileErrors
Gets an array of script compile errors.
Declaration
public string[] CompileErrors { get; }
Property Value
| Type |
|---|
| System.String[] |
CurrentDirectory
Gets or sets the current directory for this document.
Declaration
public string CurrentDirectory { get; set; }
Property Value
| Type |
|---|
| System.String |
DestroyControls
Gets or sets a value indicating whether the user controls in the document must be recreated.
Declaration
protected bool DestroyControls { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Document
Gets the HTML document after transformation.
Declaration
public XmlDocument Document { get; }
Property Value
| Type |
|---|
| System.Xml.XmlDocument |
ElementFormatsByUniqueID
Gets an hash of formats by their unique ID.
Declaration
public Hashtable ElementFormatsByUniqueID { get; }
Property Value
| Type |
|---|
| System.Collections.Hashtable |
ElementsByTagName
Gets an hash of elements by their Tag name.
Declaration
public Hashtable ElementsByTagName { get; }
Property Value
| Type |
|---|
| System.Collections.Hashtable |
ElementsByUniqueID
Gets an hash of elements by their unique ID.
Declaration
public Hashtable ElementsByUniqueID { get; }
Property Value
| Type |
|---|
| System.Collections.Hashtable |
ElementsByUserID
Gets an hash of elements by their User ID.
Declaration
public Hashtable ElementsByUserID { get; }
Property Value
| Type |
|---|
| System.Collections.Hashtable |
FileName
Gets the path to the HTML document.
Declaration
public string FileName { get; }
Property Value
| Type |
|---|
| System.String |
Formats
Gets the format manager object.
Declaration
public FormatManager Formats { get; }
Property Value
| Type |
|---|
| FormatManager |
IsDisposed
Gets a value indicating whether an instance is already disposed.
Declaration
public bool IsDisposed { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsFileName
Gets a value indicating whether the input HTML document is loaded from file.
Declaration
public bool IsFileName { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsPrinting
Gets or sets a value indicating whether the document is printing.
Declaration
protected bool IsPrinting { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsStream
Gets a value indicating whether the input HTML document is loaded from stream.
Declaration
public bool IsStream { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsUri
Gets a value indicating whether the input HTML document is loaded by Uri.
Declaration
public bool IsUri { get; }
Property Value
| Type |
|---|
| System.Boolean |
Margins
Gets the margins for the document being displayed.
Declaration
public Margins Margins { get; }
Property Value
| Type |
|---|
| Margins |
Remarks
This property exposes leftmargin, topmargin, rightmargin and bottommargin of the BODY tag.
PrevElement
Gets or sets the instance of the Tag element on which the mouse Event occurs.
Declaration
protected IHTMLElement PrevElement { get; set; }
Property Value
| Type |
|---|
| IHTMLElement |
QuietMode
Gets or sets a value indicating whether the status of quiet mode of document. If True, all interactivity changes are done without any reaction. Turn on this mode before multiple changes and turn off after all.
Declaration
public bool QuietMode { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
RenderException
Gets the exception object which occured while document parsing and rendering.
Declaration
public Exception RenderException { get; }
Property Value
| Type |
|---|
| System.Exception |
RenderRoot
Gets an instance of the body tag element.
Declaration
public IHTMLElement RenderRoot { get; }
Property Value
| Type |
|---|
| IHTMLElement |
Remarks
This element is the root for rendering.
Root
Gets the root element of the HTML elements tree.
Declaration
public IHTMLElement Root { get; }
Property Value
| Type |
|---|
| IHTMLElement |
StartPoint
Gets or sets the start point to calculate position of elements.
Declaration
[Obsolete("Don't use this property. Use Margins property instead.")]
public Point StartPoint { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Point |
Stream
Gets the HTML document stream.
Declaration
public Stream Stream { get; }
Property Value
| Type |
|---|
| System.IO.Stream |
Uri
Gets the URI to the HTML document.
Declaration
public Uri Uri { get; }
Property Value
| Type |
|---|
| System.Uri |
UserControls
Gets the list of user control wrappers in the document.
Declaration
protected ArrayList UserControls { get; }
Property Value
| Type |
|---|
| System.Collections.ArrayList |
VisibleRectangle
Gets the visible part of the document in virtual coordinates.
Declaration
protected Rectangle VisibleRectangle { get; }
Property Value
| Type |
|---|
| System.Drawing.Rectangle |
WasPainted
Gets or sets a value indicating whether element was drawn after position recalculation.
Declaration
protected bool WasPainted { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
X
Gets or sets the X coordinate for the client position of the document.
Declaration
protected int X { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
Y
Gets or sets the Y coordinate for the client position of the document.
Declaration
protected int Y { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
Methods
AddCompileError(String)
Adds compile error message to errors storage.
Declaration
protected void AddCompileError(string message)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | message | Error message to be stored. |
BeginUpdate()
Disables momentary reaction of document to some attributes changing.
Declaration
public void BeginUpdate()
ClearPendingReactions()
Clears the cache of pending reactions stored as a result of some changes.
Declaration
protected void ClearPendingReactions()
ClearRectSearcher()
Clears the Rect searcher storage.
Declaration
protected void ClearRectSearcher()
ClientToGlobal(Point)
Converts the point from client coordinates to global coordinates.
Declaration
public Point ClientToGlobal(Point point)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Point | point | Point in client coordinates. |
Returns
| Type | Description |
|---|---|
| System.Drawing.Point | Point in global coordinates. |
Clone()
Clones object.
Declaration
public InputHTML Clone()
Returns
| Type | Description |
|---|---|
| InputHTML | Cloned object. |
Dispose()
Clears all resources.
Declaration
public void Dispose()
DisposeCollection(ref ArrayList)
Overloaded. Clears and destroys the ArrayList collection.
Declaration
public void DisposeCollection(ref ArrayList coll)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.ArrayList | coll | Collection to dispose. |
DisposeCollection(ref Hashtable)
Clears and destroys an Hashtable collection.
Declaration
public void DisposeCollection(ref Hashtable coll)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Hashtable | coll | Collection to dispose. |
Draw(PaintEventArgs, Point)
Draws document to defined region.
Declaration
public void Draw(PaintEventArgs e, Point location)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.PaintEventArgs | e | Graphics context. |
| System.Drawing.Point | location | Start location for the drawing. |
EndUpdate()
Enables momentary reaction of document to some attributes changing.
Declaration
public void EndUpdate()
FromString(String, FormatManager)
Creates document from string.
Declaration
public static InputHTML FromString(string html, FormatManager manager)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | html | Html data. |
| FormatManager | manager | Format manager object. |
Returns
| Type | Description |
|---|---|
| InputHTML | New document instance. |
GetControlByElement(IHTMLElement)
Returns the custom control by its parent tag element.
Declaration
public Control GetControlByElement(IHTMLElement parent)
Parameters
| Type | Name | Description |
|---|---|---|
| IHTMLElement | parent | Parent element containing custom control. |
Returns
| Type | Description |
|---|---|
| System.Windows.Forms.Control | Control contained by the parent element if it exists; NULL otherwise. |
GetCSSFormatsToElementHash()
Overloaded. Holds an array of formats by Unique ID of element.
Declaration
public Hashtable GetCSSFormatsToElementHash()
Returns
| Type | Description |
|---|---|
| System.Collections.Hashtable | Dictionary of formats of element by uniqueID. |
GetCSSFormatsToElementHash(IHTMLElement)
Holds an array of formats by unique ID of element.
Declaration
public Hashtable GetCSSFormatsToElementHash(IHTMLElement element)
Parameters
| Type | Name | Description |
|---|---|---|
| IHTMLElement | element | Element from which format calculation starts. |
Returns
| Type | Description |
|---|---|
| System.Collections.Hashtable | Dictionary of formats for element. |
GetElementByUniqueId(String)
Returns the HTML element by its unique ID, if such exists; NULL otherwise.
Declaration
public IHTMLElement GetElementByUniqueId(string uniqueID)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | uniqueID | UniqueID of element. |
Returns
| Type | Description |
|---|---|
| IHTMLElement | Element object by its UniqueID. |
GetElementByUserId(String)
Returns the HTML element by its user ID, defined in the HTML document if such exists; NULL - otherwise.
Declaration
public IHTMLElement GetElementByUserId(string userID)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userID | ID defined in HTML document. |
Returns
| Type | Description |
|---|---|
| IHTMLElement | Element object by its user ID. |
GetElementsByName(String)
Returns an array of elements with the specified tag name.
Declaration
public IHTMLElement[] GetElementsByName(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Name of the tag. |
Returns
| Type | Description |
|---|---|
| IHTMLElement[] | Array of elements with the specified name; NULL otherwise. |
GetElementsByNameHash()
Returns the hash of elements by name.
Declaration
public Hashtable GetElementsByNameHash()
Returns
| Type | Description |
|---|---|
| System.Collections.Hashtable | Dictionary of elements with keys - names of elements. |
GetElementsByUniqueIdHash()
Returns the hash of elements by unique ID.
Declaration
public Hashtable GetElementsByUniqueIdHash()
Returns
| Type | Description |
|---|---|
| System.Collections.Hashtable | Dictionary of elements with keys - UniqueID of elements. |
GetElementsByUserIdHash()
Returns the hash of elements by ID attribute.
Declaration
public Hashtable GetElementsByUserIdHash()
Returns
| Type | Description |
|---|---|
| System.Collections.Hashtable | Dictionary of elements with keys - user ids. |
GlobalToClient(Point)
Converts point from global coordinates to client coordinates.
Declaration
public Point GlobalToClient(Point point)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Point | point | Point in global coordinates. |
Returns
| Type | Description |
|---|---|
| System.Drawing.Point | Point in client coordinates. |
OnQuietModeChanged()
Raised when quiet mode property is changed.
Declaration
protected virtual void OnQuietModeChanged()
PerformChanges()
Reacts to changes, based on changes.
Declaration
protected void PerformChanges()
RaiseQuietModeChangedEvent()
Raised event when quiet mode changes.
Declaration
protected void RaiseQuietModeChangedEvent()
Recalculate()
Recalculates document corresponding to the defined properties.
Declaration
public void Recalculate()
RecreateFormatElement(IHTMLElement)
Recreates format for this element and recalculates the document.
Declaration
protected void RecreateFormatElement(IHTMLElement element)
Parameters
| Type | Name | Description |
|---|---|---|
| IHTMLElement | element | Element for recalculating. |
RemoveElement(BaseElement)
Removes the specified element from all collections.
Declaration
protected void RemoveElement(BaseElement element)
Parameters
| Type | Name | Description |
|---|---|---|
| BaseElement | element | Element to be removed from the document. |
SetCompileErrors(ArrayList)
Sets an array of compile errors.
Declaration
protected void SetCompileErrors(ArrayList errors)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.ArrayList | errors | Array of compile errors. |
SetError(Exception)
Sets the loading exception.
Declaration
protected void SetError(Exception exception)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Exception | exception | Rendering exception object. |
SetRootElement(IHTMLElement)
Sets the root element for the document.
Declaration
protected void SetRootElement(IHTMLElement root)
Parameters
| Type | Name | Description |
|---|---|---|
| IHTMLElement | root | IHTMLElement instance |
SetStartDrawElement(IHTMLElement)
Sets the element from which drawing must be started.
Declaration
protected void SetStartDrawElement(IHTMLElement startElement)
Parameters
| Type | Name | Description |
|---|---|---|
| IHTMLElement | startElement | Element from which drawing must be started. |
Events
QuietModeChanged
Delegate. Raised when quiet mode property is changed.
Declaration
public event EventHandler QuietModeChanged
Event Type
| Type |
|---|
| System.EventHandler |
Explicit Interface Implementations
ICloneable.Clone()
Clones object.
Declaration
object ICloneable.Clone()
Returns
| Type | Description |
|---|---|
| System.Object | Cloned object. |