private void HandleRequestString(XSelectionRequestEvent evt) { if (copiedData == null || copiedData.DataType != ClipboardDataType.Text) { ISLogger.Write("{0}: cannot handle text request: Copied data is not text", ModuleName); return; } ClipboardTextData data = (ClipboardTextData)copiedData; XChangeProperty(xConnection.XDisplay, evt.requestor, evt.property, atomUtf8String, 8, 0, Encoding.UTF8.GetBytes(data.Text), data.Text.Length); }
/// <summary> /// Opens a <see cref="ClipboardHistoryDialog"/> and get the user selected <see cref="ClipboardTextData"/>. /// </summary> /// <param name="data">User selected <see cref="ClipboardTextData"/>.</param> public static bool Show(out ClipboardTextData data) { try { current = new ClipboardHistoryDialog(); var dialogResult = current.ShowDialog(Globals.MainForm); data = current.SelectedData; return(dialogResult == DialogResult.OK); } finally { current?.Dispose(); current = null; } }
public InputshareDataObject(ClipboardTextData text) { objectType = ClipboardDataType.Text; SetData(DataFormats.Text, text.Text); }