ClipboardEx
A class providing additional methods for working with the clipboard.
Definition
Namespace:Telerik.WinForms.Documents.Base
Assembly:Telerik.WinControls.RichTextEditor.dll
Syntax:
public static class ClipboardEx
Inheritance: objectClipboardEx
Properties
Collection of ClipboardHandlers that will be used when getting rich-text content from the clipboard.
public static List<ClipboardHandler> ClipboardHandlers { get; }
The clipboard handlers.
Methods
Determines whether the clipboard contains supported rich-text data.
public static bool ContainsDocument()
true if the clipboard contains document; otherwise, false.
Determines whether the clipboard contains plain text.
public static bool ContainsText(KeyEventArgs pasteKeyEventArgs)
The KeyEventArgs instance containing the event data. Use null if such is not present./>
Returns:true if the clipboard contains text; otherwise, false.
Obtains a DocumentFragment from the clipboard using the registered ClipboardHandlers.
public static DocumentFragment GetDocument()
a DocumentFragment instance representing the document created from the content inside the clipboard. If the operation is not successful, the method returns null.
Obtains a DocumentFragment from the clipboard using the registered ClipboardHandlers.
public static DocumentFragment GetDocument(out PasteSource? pasteSource)
The PasteSource that is resolved during clipboard processing.
Returns:a DocumentFragment instance representing the document created from the content inside the clipboard. If the operation is not successful, the method returns null.
Gets a DocumentFragment from clipboard using the specified data format.
public static DocumentFragment GetDocumentFromClipboard(string dataFormat, Func<string, string> clipboardStringFilter = null)
The data format. You can use the set of formats provided in the DataFormats class.
clipboardStringFilterFunc<string, string>A function to filter the string inside the clipboard. This function is used when the content needs to be formatted additionally before creating a document from it.
HTML content inserted by MS Word can be stripped using StripHtmlClipboardFormatHeaders(string).
Returns:A DocumentFragment instance representing the content. If the operation did not succeed, the method return null.
Gets a DocumentFragment from clipboard using the specified data format.
public static DocumentFragment GetDocumentFromClipboard(string dataFormat, out PasteSource? pasteSource, Func<string, string> clipboardStringFilter = null)
The data format. You can use the set of formats provided in the DataFormats class.
pasteSourcePasteSource?The PasteSource that is resolved during clipboard processing.
clipboardStringFilterFunc<string, string>A function to filter the string inside the clipboard. This function is used when the content needs to be formatted additionally before creating a document from it.
HTML content inserted by MS Word can be stripped using StripHtmlClipboardFormatHeaders(string).
Returns:A DocumentFragment instance representing the content. If the operation did not succeed, the method return null.
Places a specified data object in the system Clipboard.
public static void SetDataObject(IDataObject dataObject)
A data object (an object that implements IDataObject) to place on the system Clipboard.
Sets a document represented by a DocumentFragment instance to the specified data object.
public static void SetDocument(DocumentFragment documentFragment, IDataObject dataObject)
The document fragment.
dataObjectIDataObjectThe object the document fragment should be inserted into.
Sets a document represented by a DocumentFragment instance to the system clipboard.
public static void SetDocument(DocumentFragment documentFragment)
The document fragment.
Stores data, specified as a string, in the specified data object.
public static void SetText(string textData, DataObject dataObject)
The string representing the text data.
dataObjectDataObjectThe data object.
Stores data, specified as a string, in the system clipboard.
Strips the clipboard format headers from the HTML content inserted in the clipboard by MS Word. Skips all lines in the beginning containing ':'.