C# Class ICSharpCode.AvalonEdit.Highlighting.HtmlClipboard

Allows copying HTML text to the clipboard.
Show file Open project: kjk/kjkpub Class Usage Examples

Public Methods

Method Description
CreateHtmlFragment ( TextDocument document, DocumentHighlighter highlighter, ISegment segment, HtmlOptions options ) : string

Creates a HTML fragment from a part of a document.

SetHtml ( System.Windows.DataObject dataObject, string htmlFragment ) : void

Sets the TextDataFormat.Html on the data object to the specified html fragment. This helper methods takes care of creating the necessary CF_HTML header.

Private Methods

Method Description
BuildHeader ( int startHTML, int endHTML, int startFragment, int endFragment ) : string

Builds a header for the CF_HTML clipboard format.

EscapeHtml ( StringBuilder b, string text, HtmlOptions options ) : void

Escapes text and writes the result to the StringBuilder.

Method Details

CreateHtmlFragment() public static method

Creates a HTML fragment from a part of a document.
public static CreateHtmlFragment ( TextDocument document, DocumentHighlighter highlighter, ISegment segment, HtmlOptions options ) : string
document ICSharpCode.AvalonEdit.Document.TextDocument The document to create HTML from.
highlighter DocumentHighlighter The highlighter used to highlight the document.
segment ISegment The part of the document to create HTML for. You can pass null to create HTML for the whole document.
options HtmlOptions The options for the HTML creation.
return string

SetHtml() public static method

Sets the TextDataFormat.Html on the data object to the specified html fragment. This helper methods takes care of creating the necessary CF_HTML header.
public static SetHtml ( System.Windows.DataObject dataObject, string htmlFragment ) : void
dataObject System.Windows.DataObject
htmlFragment string
return void