I am working with Cut copy Paste functionality of my class objects. I am able to keep the data on Clipboard and get it back for this purpose.
Now what I am trying is to get the same data on some other text editor through ctrl+V or paste operation provided by that text editor.
The code for setting the data on clipboard is :
/// <summary>
/// Set elements on the clipboard.
/// </summary>
/// <param name="object">object to be stored on the clipboard.</param>
private static void SetElementsOnClipboard(CustomData object)
{
Tuple<string, Type> serializedElement = null;
var data = new System.Windows.DataObject();
serializedElement = new Tuple<string, Type>(SerialiseData(object), object.GetType());
data.SetData("SomeKey", serializedElement);
System.Windows.Clipboard.SetDataObject(data);
}
Here the method SerialiseData(CustomData object)
returns a string object that I want to paste in other text editor.
I would appreciate any help.