protected override void Run() { if (IdeApp.Workbench.RootWindow.HasToplevelFocus) { Gtk.Editable editable = IdeApp.Workbench.RootWindow.Focus as Gtk.Editable; if (editable != null) { editable.CutClipboard(); 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.CutClipboard(clipboard, true); return; } #if MAC var mactv = AppKit.NSApplication.SharedApplication.KeyWindow.FirstResponder as AppKit.NSText; if (mactv != null) { mactv.Cut(mactv); return; } #endif } }
protected override void Run() { #if WIN32 var wintv = System.Windows.Input.Keyboard.FocusedElement; var cmd = System.Windows.Input.ApplicationCommands.Cut; 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.CutClipboard(); 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.CutClipboard(clipboard, true); 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.Cut(mactv); } else { AppKit.NSApplication.SharedApplication.SendAction(cutSelector, focusView, keyWindow); } return; } #endif }
protected override void Run() { if (IdeApp.Workbench.RootWindow.HasToplevelFocus) { Gtk.Editable editable = IdeApp.Workbench.RootWindow.Focus as Gtk.Editable; if (editable != null) { editable.CutClipboard(); 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.CutClipboard(clipboard, true); return; } } }