protected override void Run()
 {
     if (IdeApp.Workbench.RootWindow.HasToplevelFocus)
     {
         Gtk.Editable editable = IdeApp.Workbench.RootWindow.Focus as Gtk.Editable;
         if (editable != null)
         {
             editable.PasteClipboard();
             return;
         }
         Gtk.TextView tv = IdeApp.Workbench.RootWindow.Focus as Gtk.TextView;
         if (tv != null)
         {
             Gtk.Clipboard clipboard = Gtk.Clipboard.Get(Gdk.Atom.Intern("CLIPBOARD", false));
             tv.Buffer.PasteClipboard(clipboard);
             return;
         }
                         #if MAC
         var mactv = AppKit.NSApplication.SharedApplication.KeyWindow.FirstResponder as AppKit.NSText;
         if (mactv != null)
         {
             mactv.Paste(mactv);
             return;
         }
                         #endif
     }
 }
Beispiel #2
0
        protected override void Run()
        {
                        #if WIN32
            var wintv = System.Windows.Input.Keyboard.FocusedElement;
            var cmd   = System.Windows.Input.ApplicationCommands.Paste;
            if (wintv != null && cmd.CanExecute(null, wintv))
            {
                cmd.Execute(null, wintv);
                return;
            }
                        #endif
            if (IdeApp.Workbench.RootWindow.HasToplevelFocus)
            {
                Gtk.Editable editable = IdeApp.Workbench.RootWindow.Focus as Gtk.Editable;
                if (editable != null)
                {
                    editable.PasteClipboard();
                    return;
                }
                Gtk.TextView tv = IdeApp.Workbench.RootWindow.Focus as Gtk.TextView;
                if (tv != null)
                {
                    Gtk.Clipboard clipboard = Gtk.Clipboard.Get(Gdk.Atom.Intern("CLIPBOARD", false));
                    tv.Buffer.PasteClipboard(clipboard);
                    return;
                }
            }

                        #if MAC
            var keyWindow = AppKit.NSApplication.SharedApplication.KeyWindow;
            var focusView = keyWindow?.FirstResponder;
            if (focusView != null)
            {
                var mactv = focusView as AppKit.NSText;
                if (mactv != null)
                {
                    mactv.Paste(mactv);
                }
                else
                {
                    AppKit.NSApplication.SharedApplication.SendAction(pasteSelector, focusView, keyWindow);
                }
                return;
            }
                        #endif
        }
Beispiel #3
0
 protected override void Run()
 {
     if (IdeApp.Workbench.RootWindow.HasToplevelFocus)
     {
         Gtk.Editable editable = IdeApp.Workbench.RootWindow.Focus as Gtk.Editable;
         if (editable != null)
         {
             editable.PasteClipboard();
             return;
         }
         Gtk.TextView tv = IdeApp.Workbench.RootWindow.Focus as Gtk.TextView;
         if (tv != null)
         {
             Gtk.Clipboard clipboard = Gtk.Clipboard.Get(Gdk.Atom.Intern("CLIPBOARD", false));
             tv.Buffer.PasteClipboard(clipboard);
             return;
         }
     }
 }