예제 #1
0
 protected virtual void OnClipboardDataChanged(ClipboardItem item)
 {
 }
예제 #2
0
        protected void ClipboardUpdated()
        {
            ClipboardItem ci = new ClipboardItem();

            if (Clipboard.ContainsText())
            {
                ci.DataType = ClipboardDataType.Text;
                ci.Name = Clipboard.GetText();
                ci.AddtionalInfo = "System.String";
                ci.Format = Clipboard.GetDataObject().GetFormats()[0];
                ci.Data = Clipboard.GetText();
            }
            else if (Clipboard.ContainsImage())
            {
                ci.DataType = ClipboardDataType.Image;
                ci.AddtionalInfo = "System.Drawing.Image";
                ci.Data = Clipboard.GetImage();
                ci.Format = Clipboard.GetDataObject().GetFormats()[0];
                ci.Name = string.Format("Image ({0} bytes)", System.Runtime.InteropServices.Marshal.SizeOf(ci.Data));
            }
            else if (Clipboard.ContainsFileDropList())
            {
                ci.DataType = ClipboardDataType.Files;
                ci.AddtionalInfo = "File(s) List";
                ci.Format = Clipboard.GetDataObject().GetFormats()[0];
                ci.Data = Clipboard.GetFileDropList();
            }
            else
                return;

            ClipboardDataChanged(ci);
        }
예제 #3
0
파일: MainForm.cs 프로젝트: cborrow/Clips
 private void clipboardListener_ClipboardDataChanged(ClipboardItem item)
 {
     clipsListBox1.Items.Add(item);
 }