示例#1
0
        private static void RaiseClipboardUpdated(ClipboardChangedEventArgs e)
        {
            var handler = ClipboardUpdated;

            if (handler != null)
            {
                handler(null, e);
            }
        }
示例#2
0
            private void OnClipboardUpdated()
            {
                var iData = Clipboard.GetDataObject();

                if (iData != null)
                {
                    var args = new ClipboardChangedEventArgs();
                    if (iData.GetDataPresent(DataFormats.Bitmap))
                    {
                        args.BitmapSource = iData.GetData(DataFormats.Bitmap) as BitmapSource;
                    }

                    if (iData.GetDataPresent(DataFormats.Text))
                    {
                        args.Text = iData.GetData(DataFormats.Text) as string;
                    }

                    RaiseClipboardUpdated(args);
                }
            }