public override void SetClipboardData(ClipboardDataBase data) { InputshareDataObject obj = null; try { obj = ClipboardTranslatorWindows.ConvertToWindows(data); } catch (Exception ex) { ISLogger.Write("Failed to convert clipboard data: " + ex.Message); } if (obj != null) { cbHookWindow.SetClipboardData(obj); } }
public override void SetClipboardData(ClipboardDataBase data) { InputshareDataObject obj = new InputshareDataObject(data, false); if (data.DataType == ClipboardDataType.File) { //If two applications paste data, we can't know which of the two we are interacting with. //In other words, we don't know if its program A or program B calling GetData() on the InputshareDataObject //this means that files will just be corrupted if two programs try to paste the data //To fix this, as soon as the data is pasted, we put another InputshareDataObject onto the clipboard. //Each dataobject gets their own access token from the host to allow them to have seperate filestreams //and allow any number of programs to paste at the same time currentClipboardFiles = data as ClipboardVirtualFileData; obj.FilesPasted += Obj_ObjectPasted; } cbHookWindow.SetClipboardData(obj); }