ClassClipboardEx
A class providing additional methods for working with the clipboard.
Definition
Namespace:Telerik.Windows.Documents.Base
Assembly:Telerik.Windows.Controls.RichTextBox.dll
Syntax:
public static class ClipboardEx
Inheritance: objectClipboardEx
Properties
ClipboardHandlers
Collection of ClipboardHandlers that will be used when getting rich-text content from the clipboard.
Declaration
public static List<ClipboardHandler> ClipboardHandlers { get; }
Property Value
The clipboard handlers.
Methods
ContainsDocument()
Determines whether the clipboard contains supported rich-text data.
Declaration
public static bool ContainsDocument()
Returns
true if the clipboard contains document; otherwise, false.
ContainsText(KeyEventArgs)
Determines whether the clipboard contains plain text.
GetDocument()
Obtains a DocumentFragment from the clipboard using the registered ClipboardHandlers.
Declaration
public static DocumentFragment GetDocument()
Returns
a DocumentFragment instance representing the document created from the content inside the clipboard. If the operation is not successful, the method returns null.
GetDocument(out PasteSource?)
Obtains a DocumentFragment from the clipboard using the registered ClipboardHandlers.
Declaration
public static DocumentFragment GetDocument(out PasteSource? pasteSource)
Parameters
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.
GetDocumentFromClipboard(string, Func<string, string>)
Gets a DocumentFragment from clipboard using the specified data format.
Declaration
public static DocumentFragment GetDocumentFromClipboard(string dataFormat, Func<string, string> clipboardStringFilter = null)
Parameters
dataFormat
The data format. You can use the set of formats provided in the class.
clipboardStringFilter
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.
GetDocumentFromClipboard(string, out PasteSource?, Func<string, string>)
Gets a DocumentFragment from clipboard using the specified data format.
Declaration
public static DocumentFragment GetDocumentFromClipboard(string dataFormat, out PasteSource? pasteSource, Func<string, string> clipboardStringFilter = null)
Parameters
dataFormat
The data format. You can use the set of formats provided in the class.
pasteSource
The PasteSource that is resolved during clipboard processing.
clipboardStringFilter
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.
GetText()
Gets the clipboard data of type .
SetDataObject(IDataObject)
Places a specified data object in the system Clipboard.
Declaration
public static void SetDataObject(IDataObject dataObject)
Parameters
dataObject
IDataObject
A data object (an object that implements IDataObject) to place on the system Clipboard.
SetDocument(DocumentFragment)
Sets a document represented by a DocumentFragment instance to the system clipboard.
Declaration
public static void SetDocument(DocumentFragment documentFragment)
Parameters
documentFragment
The document fragment.
SetDocument(DocumentFragment, IDataObject)
Sets a document represented by a DocumentFragment instance to the specified data object.
Declaration
public static void SetDocument(DocumentFragment documentFragment, IDataObject dataObject)
Parameters
documentFragment
The document fragment.
dataObject
IDataObject
The object the document fragment should be inserted into.
SetText(string)
Stores data, specified as a string, in the system clipboard.
Declaration
public static void SetText(string textData)
Parameters
textData
The text data.
SetText(string, DataObject)
Stores data, specified as a string, in the specified data object.
Declaration
public static void SetText(string textData, DataObject dataObject)
Parameters
textData
The string representing the text data.
dataObject
DataObject
The data object.
StripHtmlClipboardFormatHeaders(string)
Strips the clipboard format headers from the HTML content inserted in the clipboard by MS Word. Skips all lines in the beginning containing ':'.