예제 #1
0
        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);
        }
예제 #2
0
 /// <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;
     }
 }
예제 #3
0
 public InputshareDataObject(ClipboardTextData text)
 {
     objectType = ClipboardDataType.Text;
     SetData(DataFormats.Text, text.Text);
 }