Exemple #1
0
 protected virtual void OnClipboardContentChanged(ClipboardContentChangedEventArgs e)
 {
     if (isStarted)
     {
         ClipboardContentChanged?.Invoke(this, e);
     }
 }
        public void SetText(string text)
        {
            Clear();

            System.Windows.Clipboard.SetText(text);

            ClipboardContentChanged?.Invoke(this, EventArgs.Empty);
        }
Exemple #3
0
        /// <summary>
        /// Handles wind32 interop messages.
        /// </summary>
        private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
        {
            if (msg == (int)NativeMethods.WM.CLIPBOARDUPDATE)
            {
                ClipboardContentChanged?.Invoke(this, EventArgs.Empty);
                handled = true;
            }

            return(IntPtr.Zero);
        }
        public void SetFiles(IEnumerable <string> paths, ClipboardFilesState filesState)
        {
            Clear();

            FilesState = filesState;

            var collection = new StringCollection();

            foreach (var t in paths)
            {
                collection.Add(t);
            }

            System.Windows.Clipboard.SetFileDropList(collection);

            ClipboardContentChanged?.Invoke(this, EventArgs.Empty);
        }
Exemple #5
0
 public void NotifyClipboardContentChanged(bool fromView, string newContent)
 {
     ClipboardContentChanged?.Invoke(fromView, newContent);
 }
 protected void OnClipboardDataChanged(ClipboardDataBase data)
 {
     ClipboardContentChanged?.Invoke(this, data);
 }