C# Class MonoDevelop.Components.Commands.CommandManager

Inheritance: IDisposable
显示文件 Open project: powerumc/monodevelop_korean Class Usage Examples

Private Properties

Property Type Description
AddUpdateHandler CommandUpdaterInfo
AddUpdater void
CanUseBinding bool
ChainHandler ICommandArrayTargetHandler
ChainHandler ICommandArrayUpdateHandler
ChainHandler ICommandTargetHandler
ChainHandler ICommandUpdateHandler
CreateMenu Gtk.Menu
CreateMenuBar Gtk.MenuBar
CreateMenuBar Gtk.MenuBar
DefaultDispatchCommand bool
DefaultUpdateCommandInfo void
DispatchCommandFromAccel bool
EndWaitingForUserInteraction void
GetActiveWidget object
GetActiveWindow Gtk.Window
GetCurrentFocusedTopLevelWindow Gtk.Window
GetFirstCommandTarget object
GetFocusedChild Gtk.Widget
GetNextCommandTarget object
GetTypeHandlerInfo HandlerTypeInfo
HandleButtonPressEvent void
HandleFocusInEventHandler void
HandleWinMotionNotifyEvent void
IsEmbeddedNSView bool
IsRootGdkQuartzView bool
NextMulticastTarget object
NotifyCommandTargetScanFinished void
NotifyCommandTargetScanStarted void
NotifyDeselected void
NotifyIncompleteKeyPressed void
NotifyIncompleteKeyReleased void
NotifyKeyPressed void
NotifySelected void
OnCommandActivated void
OnCommandActivating void
OnExtensionChange void
OnKeyPressed void
OnKeyReleased void
OnNSEventKeyPress AppKit.NSEvent
ProcessKeyEvent bool
RegisterTopWindow void
RegisterUserInteraction void
StartStatusUpdater void
StartWaitingForUserInteraction void
StopStatusUpdater void
StopStatusUpdaterIfNeeded void
TopLevelDestroyed void
UpdateAppFocusStatus void
UpdateStatus bool
UpdateToolbars void

Public Methods

Method Description
CommandManager ( ) : System
CommandManager ( Window root ) : System
CreateCommandEntrySet ( Mono.Addins.ExtensionContext ctx, string addinPath ) : MonoDevelop.Components.Commands.CommandEntrySet

Creates a command entry set.

CreateCommandEntrySet ( string addinPath ) : MonoDevelop.Components.Commands.CommandEntrySet

Creates a command entry set.

CreateMenu ( MonoDevelop.Components.Commands.CommandEntrySet entrySet ) : Gtk.Menu

Creates a menu.

CreateMenu ( MonoDevelop.Components.Commands.CommandEntrySet entrySet, EventHandler closeHandler ) : Gtk.Menu

Creates a menu.

CreateMenu ( MonoDevelop.Components.Commands.CommandEntrySet entrySet, object initialTarget ) : Gtk.Menu

Creates the menu.

CreateMenu ( MonoDevelop.Components.Commands.CommandEntrySet entrySet, object initialTarget, EventHandler closeHandler ) : Gtk.Menu

Creates the menu.

CreateMenu ( string addinPath ) : Gtk.Menu

Creates a menu from the provided extension path

CreateNSMenu ( MonoDevelop.Components.Commands.CommandEntrySet entrySet ) : AppKit.NSMenu

Creates a menu.

CreateNSMenu ( MonoDevelop.Components.Commands.CommandEntrySet entrySet, object initialTarget ) : AppKit.NSMenu

Creates the menu.

CreateNSMenu ( MonoDevelop.Components.Commands.CommandEntrySet entrySet, object initialTarget, EventHandler closeHandler ) : AppKit.NSMenu

Creates the menu.

DispatchCommand ( object commandId ) : bool

Dispatches a command.

This methods tries to execute a command by looking for a handler in the active command route.

DispatchCommand ( object commandId, CommandSource source ) : bool

Dispatches a command.

DispatchCommand ( object commandId, object dataItem ) : bool

Dispatches a command.

DispatchCommand ( object commandId, object dataItem, CommandSource source ) : bool

Dispatches a command.

DispatchCommand ( object commandId, object dataItem, object initialTarget ) : bool

Dispatches a command.

DispatchCommand ( object commandId, object dataItem, object initialTarget, CommandSource source ) : bool

Dispatches a command.

Dispose ( ) : void
GetActionCommand ( object cmdId ) : MonoDevelop.Components.Commands.ActionCommand

Gets an action command.

GetCommand ( object cmdId ) : MonoDevelop.Components.Commands.Command

Gets a registered command.

GetCommandInfo ( object commandId ) : MonoDevelop.Components.Commands.CommandInfo

Retrieves status information about a command by looking for a handler in the active command route.

GetCommandInfo ( object commandId, CommandTargetRoute targetRoute ) : MonoDevelop.Components.Commands.CommandInfo

Retrieves status information about a command by looking for a handler in the active command route.

GetCommands ( ) : IEnumerable

Gets all registered commands

LoadCommands ( string addinPath ) : void

Loads command definitions from the provided extension path

LoadKeyBindingSchemes ( string addinPath ) : void

Loads key binding schemes from the provided extension path

LoadUserBindings ( ) : void

Loads user defined key bindings.

LockAll ( ) : bool

Disables all commands

RegisterCommand ( MonoDevelop.Components.Commands.Command cmd ) : void

Registers a new command.

RegisterCommandBar ( ICommandBar commandBar ) : void
RegisterCommandTargetVisitor ( ICommandTargetVisitor visitor ) : void

Registers a command target visitor.

Command target visitors can be used to visit the whole active command route to perform custom actions on the objects of the route. The command manager periodically visits the command route. The visit frequency varies, but it is usually at least once a second.

RegisterGlobalHandler ( object handler ) : void

Registers a global command handler.

Global command handler are added to the end of the command route.

ReportError ( object commandId, string message, Exception ex ) : void
SetRootWindow ( Window root ) : void

Sets the root window. The manager will start the command route at this window, if no other is active.

ShowContextMenu ( Control parent, Gdk evt, MonoDevelop.Components.Commands.CommandEntrySet entrySet, object initialCommandTarget = null ) : bool

Shows a context menu.

ShowContextMenu ( Control parent, Gdk evt, MonoDevelop.Components.Commands.CommandEntrySet entrySet, object initialCommandTarget, EventHandler closeHandler ) : bool

Shows a context menu.

ShowContextMenu ( Control parent, int x, int y, MonoDevelop.Components.Commands.CommandEntrySet entrySet, object initialCommandTarget = null ) : bool

Shows the context menu.

ShowContextMenu ( Control parent, Gdk evt, Mono.Addins.ExtensionContext ctx, string addinPath ) : void

Shows a context menu.

ShowContextMenu ( Control parent, Gdk evt, Gtk menu, object initialCommandTarget = null ) : void

Shows a context menu.

ShowContextMenu ( Control parent, Gdk evt, string addinPath ) : void

Shows a context menu.

ShowContextMenu ( Control parent, int x, int y, Gtk menu, object initialCommandTarget = null ) : void
ToCommandId ( object ob ) : object
UnlockAll ( ) : bool

Unlocks the command manager

UnregisterCommand ( MonoDevelop.Components.Commands.Command cmd ) : void

Unregisters a command.

UnregisterCommandBar ( ICommandBar commandBar ) : void
UnregisterCommandTargetVisitor ( ICommandTargetVisitor visitor ) : void

Unregisters a command target visitor.

UnregisterGlobalHandler ( object handler ) : void

Unregisters a global handler.

VisitCommandTargets ( ICommandTargetVisitor visitor, object initialTarget ) : object

Visits the active command route

Private Methods

Method Description
AddUpdateHandler ( List methodUpdaters, object cmdId ) : CommandUpdaterInfo
AddUpdater ( List methodUpdaters, MethodInfo method, MonoDevelop.Components.Commands.CommandUpdateHandlerAttribute attr ) : void
CanUseBinding ( KeyboardShortcut chords, KeyboardShortcut accels, KeyBinding &binding, bool &isChord ) : bool
ChainHandler ( ICommandArrayTargetHandler chain, object attr ) : ICommandArrayTargetHandler
ChainHandler ( ICommandArrayUpdateHandler chain, object attr ) : ICommandArrayUpdateHandler
ChainHandler ( ICommandTargetHandler chain, object attr ) : ICommandTargetHandler
ChainHandler ( ICommandUpdateHandler chain, object attr ) : ICommandUpdateHandler
CreateMenu ( MonoDevelop.Components.Commands.CommandEntrySet entrySet, MonoDevelop.Components.Commands.CommandMenu menu ) : Gtk.Menu

Appends commands to a menu

CreateMenuBar ( string addinPath ) : Gtk.MenuBar

Creates a menu bar from the menu definition at the provided extension path

CreateMenuBar ( string name, MonoDevelop.Components.Commands.CommandEntrySet entrySet ) : Gtk.MenuBar

Creates a menu bar.

DefaultDispatchCommand ( MonoDevelop.Components.Commands.ActionCommand cmd, MonoDevelop.Components.Commands.CommandInfo info, object dataItem, object target, CommandSource source ) : bool
DefaultUpdateCommandInfo ( MonoDevelop.Components.Commands.ActionCommand cmd, MonoDevelop.Components.Commands.CommandInfo info ) : void
DispatchCommandFromAccel ( object commandId, object dataItem, object initialTarget ) : bool
EndWaitingForUserInteraction ( ) : void
GetActiveWidget ( Gtk win ) : object
GetActiveWindow ( Gtk win ) : Gtk.Window
GetCurrentFocusedTopLevelWindow ( ) : Gtk.Window
GetFirstCommandTarget ( CommandTargetRoute targetRoute ) : object
GetFocusedChild ( Gtk widget ) : Gtk.Widget
GetNextCommandTarget ( CommandTargetRoute targetRoute, object cmdTarget, bool ignoreDelegator = false ) : object
GetTypeHandlerInfo ( object cmdTarget ) : HandlerTypeInfo
HandleButtonPressEvent ( object o, Gtk args ) : void
HandleFocusInEventHandler ( object o, Gtk args ) : void
HandleWinMotionNotifyEvent ( object o, Gtk args ) : void
IsEmbeddedNSView ( AppKit view ) : bool
IsRootGdkQuartzView ( AppKit view ) : bool
NextMulticastTarget ( CommandTargetRoute targetRoute ) : object
NotifyCommandTargetScanFinished ( ) : void
NotifyCommandTargetScanStarted ( ) : void
NotifyDeselected ( ) : void
NotifyIncompleteKeyPressed ( Gdk ev ) : void
NotifyIncompleteKeyReleased ( Gdk ev ) : void
NotifyKeyPressed ( Gdk ev ) : void
NotifySelected ( MonoDevelop.Components.Commands.CommandInfo cmdInfo ) : void
OnCommandActivated ( object commandId, MonoDevelop.Components.Commands.CommandInfo commandInfo, object dataItem, object target, CommandSource source, System.TimeSpan time ) : void
OnCommandActivating ( object commandId, MonoDevelop.Components.Commands.CommandInfo commandInfo, object dataItem, object target, CommandSource source ) : void
OnExtensionChange ( object s, Mono.Addins.ExtensionNodeEventArgs args ) : void
OnKeyPressed ( object o, Gtk e ) : void
OnKeyReleased ( object o, Gtk e ) : void
OnNSEventKeyPress ( AppKit ev ) : AppKit.NSEvent
ProcessKeyEvent ( Gdk ev ) : bool
RegisterTopWindow ( Gtk win ) : void
RegisterUserInteraction ( ) : void
StartStatusUpdater ( ) : void
StartWaitingForUserInteraction ( ) : void
StopStatusUpdater ( ) : void
StopStatusUpdaterIfNeeded ( ) : void
TopLevelDestroyed ( object o, EventArgs args ) : void
UpdateAppFocusStatus ( bool hasFocus, bool lastFocusedExists ) : void
UpdateStatus ( ) : bool
UpdateToolbars ( ) : void

Method Details

CommandManager() public method

public CommandManager ( ) : System
return System

CommandManager() public method

public CommandManager ( Window root ) : System
root Window
return System

CreateCommandEntrySet() public method

Creates a command entry set.
public CreateCommandEntrySet ( Mono.Addins.ExtensionContext ctx, string addinPath ) : MonoDevelop.Components.Commands.CommandEntrySet
ctx Mono.Addins.ExtensionContext /// Extension context to use to query the extension path ///
addinPath string /// Extension path with the command definitions ///
return MonoDevelop.Components.Commands.CommandEntrySet

CreateCommandEntrySet() public method

Creates a command entry set.
public CreateCommandEntrySet ( string addinPath ) : MonoDevelop.Components.Commands.CommandEntrySet
addinPath string /// Extension path with the command definitions ///
return MonoDevelop.Components.Commands.CommandEntrySet

CreateMenu() public method

Creates a menu.
public CreateMenu ( MonoDevelop.Components.Commands.CommandEntrySet entrySet ) : Gtk.Menu
entrySet MonoDevelop.Components.Commands.CommandEntrySet /// Entry with the command definitions ///
return Gtk.Menu

CreateMenu() public method

Creates a menu.
public CreateMenu ( MonoDevelop.Components.Commands.CommandEntrySet entrySet, EventHandler closeHandler ) : Gtk.Menu
entrySet MonoDevelop.Components.Commands.CommandEntrySet /// Entry with the command definitions ///
closeHandler EventHandler /// EventHandler to be run when the menu closes ///
return Gtk.Menu

CreateMenu() public method

Creates the menu.
public CreateMenu ( MonoDevelop.Components.Commands.CommandEntrySet entrySet, object initialTarget ) : Gtk.Menu
entrySet MonoDevelop.Components.Commands.CommandEntrySet /// Entry with the command definitions ///
initialTarget object /// Initial command route target. The command handler will start looking for command handlers in this object. ///
return Gtk.Menu

CreateMenu() public method

Creates the menu.
public CreateMenu ( MonoDevelop.Components.Commands.CommandEntrySet entrySet, object initialTarget, EventHandler closeHandler ) : Gtk.Menu
entrySet MonoDevelop.Components.Commands.CommandEntrySet /// Entry with the command definitions ///
initialTarget object /// Initial command route target. The command handler will start looking for command handlers in this object. ///
closeHandler EventHandler /// EventHandler to be run when the menu closes ///
return Gtk.Menu

CreateMenu() public method

Creates a menu from the provided extension path
public CreateMenu ( string addinPath ) : Gtk.Menu
addinPath string
return Gtk.Menu

CreateNSMenu() public method

Creates a menu.
public CreateNSMenu ( MonoDevelop.Components.Commands.CommandEntrySet entrySet ) : AppKit.NSMenu
entrySet MonoDevelop.Components.Commands.CommandEntrySet /// Entry with the command definitions ///
return AppKit.NSMenu

CreateNSMenu() public method

Creates the menu.
public CreateNSMenu ( MonoDevelop.Components.Commands.CommandEntrySet entrySet, object initialTarget ) : AppKit.NSMenu
entrySet MonoDevelop.Components.Commands.CommandEntrySet /// Entry with the command definitions ///
initialTarget object /// Initial command route target. The command handler will start looking for command handlers in this object. ///
return AppKit.NSMenu

CreateNSMenu() public method

Creates the menu.
public CreateNSMenu ( MonoDevelop.Components.Commands.CommandEntrySet entrySet, object initialTarget, EventHandler closeHandler ) : AppKit.NSMenu
entrySet MonoDevelop.Components.Commands.CommandEntrySet /// Entry with the command definitions ///
initialTarget object /// Initial command route target. The command handler will start looking for command handlers in this object. ///
closeHandler EventHandler /// EventHandler to be run when the menu closes ///
return AppKit.NSMenu

DispatchCommand() public method

Dispatches a command.
This methods tries to execute a command by looking for a handler in the active command route.
public DispatchCommand ( object commandId ) : bool
commandId object /// Identifier of the command ///
return bool

DispatchCommand() public method

Dispatches a command.
public DispatchCommand ( object commandId, CommandSource source ) : bool
commandId object /// Identifier of the command ///
source CommandSource /// What is causing the command to be dispatched ///
return bool

DispatchCommand() public method

Dispatches a command.
public DispatchCommand ( object commandId, object dataItem ) : bool
commandId object /// Identifier of the command ///
dataItem object /// Data item for the command. It must be one of the data items obtained by calling GetCommandInfo. ///
return bool

DispatchCommand() public method

Dispatches a command.
public DispatchCommand ( object commandId, object dataItem, CommandSource source ) : bool
commandId object /// Identifier of the command ///
dataItem object /// Data item for the command. It must be one of the data items obtained by calling GetCommandInfo. ///
source CommandSource /// What is causing the command to be dispatched ///
return bool

DispatchCommand() public method

Dispatches a command.
public DispatchCommand ( object commandId, object dataItem, object initialTarget ) : bool
commandId object /// Identifier of the command ///
dataItem object /// Data item for the command. It must be one of the data items obtained by calling GetCommandInfo. ///
initialTarget object /// Initial command route target. The command handler will start looking for command handlers in this object. ///
return bool

DispatchCommand() public method

Dispatches a command.
public DispatchCommand ( object commandId, object dataItem, object initialTarget, CommandSource source ) : bool
commandId object /// Identifier of the command ///
dataItem object /// Data item for the command. It must be one of the data items obtained by calling GetCommandInfo. ///
initialTarget object /// Initial command route target. The command handler will start looking for command handlers in this object. ///
source CommandSource /// What is causing the command to be dispatched ///
return bool

Dispose() public method

public Dispose ( ) : void
return void

GetActionCommand() public method

Gets an action command.
public GetActionCommand ( object cmdId ) : MonoDevelop.Components.Commands.ActionCommand
cmdId object /// The command identifier. ///
return MonoDevelop.Components.Commands.ActionCommand

GetCommand() public method

Gets a registered command.
public GetCommand ( object cmdId ) : MonoDevelop.Components.Commands.Command
cmdId object /// The identifier of the command ///
return MonoDevelop.Components.Commands.Command

GetCommandInfo() public method

Retrieves status information about a command by looking for a handler in the active command route.
public GetCommandInfo ( object commandId ) : MonoDevelop.Components.Commands.CommandInfo
commandId object /// Identifier of the command. ///
return MonoDevelop.Components.Commands.CommandInfo

GetCommandInfo() public method

Retrieves status information about a command by looking for a handler in the active command route.
public GetCommandInfo ( object commandId, CommandTargetRoute targetRoute ) : MonoDevelop.Components.Commands.CommandInfo
commandId object /// Identifier of the command. ///
targetRoute CommandTargetRoute /// Command route origin ///
return MonoDevelop.Components.Commands.CommandInfo

GetCommands() public method

Gets all registered commands
public GetCommands ( ) : IEnumerable
return IEnumerable

LoadCommands() public method

Loads command definitions from the provided extension path
public LoadCommands ( string addinPath ) : void
addinPath string
return void

LoadKeyBindingSchemes() public method

Loads key binding schemes from the provided extension path
public LoadKeyBindingSchemes ( string addinPath ) : void
addinPath string
return void

LoadUserBindings() public method

Loads user defined key bindings.
public LoadUserBindings ( ) : void
return void

LockAll() public method

Disables all commands
public LockAll ( ) : bool
return bool

RegisterCommand() public method

Registers a new command.
public RegisterCommand ( MonoDevelop.Components.Commands.Command cmd ) : void
cmd MonoDevelop.Components.Commands.Command /// The command. ///
return void

RegisterCommandBar() public method

public RegisterCommandBar ( ICommandBar commandBar ) : void
commandBar ICommandBar
return void

RegisterCommandTargetVisitor() public method

Registers a command target visitor.
Command target visitors can be used to visit the whole active command route to perform custom actions on the objects of the route. The command manager periodically visits the command route. The visit frequency varies, but it is usually at least once a second.
public RegisterCommandTargetVisitor ( ICommandTargetVisitor visitor ) : void
visitor ICommandTargetVisitor /// The visitor. ///
return void

RegisterGlobalHandler() public method

Registers a global command handler.
Global command handler are added to the end of the command route.
public RegisterGlobalHandler ( object handler ) : void
handler object /// The handler ///
return void

ReportError() public method

public ReportError ( object commandId, string message, Exception ex ) : void
commandId object
message string
ex System.Exception
return void

SetRootWindow() public method

Sets the root window. The manager will start the command route at this window, if no other is active.
public SetRootWindow ( Window root ) : void
root Window
return void

ShowContextMenu() public method

Shows a context menu.
public ShowContextMenu ( Control parent, Gdk evt, MonoDevelop.Components.Commands.CommandEntrySet entrySet, object initialCommandTarget = null ) : bool
parent Control /// Widget for which the context menu is being shown ///
evt Gdk /// Current event ///
entrySet MonoDevelop.Components.Commands.CommandEntrySet /// Entry with the command definitions ///
initialCommandTarget object /// Initial command route target. The command handler will start looking for command handlers in this object. ///
return bool

ShowContextMenu() public method

Shows a context menu.
public ShowContextMenu ( Control parent, Gdk evt, MonoDevelop.Components.Commands.CommandEntrySet entrySet, object initialCommandTarget, EventHandler closeHandler ) : bool
parent Control /// Widget for which the context menu is being shown ///
evt Gdk /// Current event ///
entrySet MonoDevelop.Components.Commands.CommandEntrySet /// Entry with the command definitions ///
initialCommandTarget object /// Initial command route target. The command handler will start looking for command handlers in this object. ///
closeHandler EventHandler /// An event handler which will be called when the menu closes ///
return bool

ShowContextMenu() public method

Shows the context menu.
public ShowContextMenu ( Control parent, int x, int y, MonoDevelop.Components.Commands.CommandEntrySet entrySet, object initialCommandTarget = null ) : bool
parent Control Widget for which the context menu is shown
x int The x coordinate.
y int The y coordinate.
entrySet MonoDevelop.Components.Commands.CommandEntrySet Entry set with the command definitions
initialCommandTarget object Initial command target.
return bool

ShowContextMenu() public method

Shows a context menu.
public ShowContextMenu ( Control parent, Gdk evt, Mono.Addins.ExtensionContext ctx, string addinPath ) : void
parent Control /// Widget for which the context menu is being shown ///
evt Gdk /// Current event object ///
ctx Mono.Addins.ExtensionContext /// Extension context to use to query the extension path ///
addinPath string /// Extension path to the definition of the menu ///
return void

ShowContextMenu() public method

Shows a context menu.
public ShowContextMenu ( Control parent, Gdk evt, Gtk menu, object initialCommandTarget = null ) : void
parent Control /// Widget for which the context menu is being shown ///
evt Gdk /// Current event ///
menu Gtk /// Menu to be shown ///
initialCommandTarget object /// Initial command route target. The command handler will start looking for command handlers in this object. ///
return void

ShowContextMenu() public method

Shows a context menu.
public ShowContextMenu ( Control parent, Gdk evt, string addinPath ) : void
parent Control /// Widget for which the context menu is being shown ///
evt Gdk /// Current event object ///
addinPath string /// Extension path to the definition of the menu ///
return void

ShowContextMenu() public method

public ShowContextMenu ( Control parent, int x, int y, Gtk menu, object initialCommandTarget = null ) : void
parent Control
x int
y int
menu Gtk
initialCommandTarget object
return void

ToCommandId() public static method

public static ToCommandId ( object ob ) : object
ob object
return object

UnlockAll() public method

Unlocks the command manager
public UnlockAll ( ) : bool
return bool

UnregisterCommand() public method

Unregisters a command.
public UnregisterCommand ( MonoDevelop.Components.Commands.Command cmd ) : void
cmd MonoDevelop.Components.Commands.Command /// The command. ///
return void

UnregisterCommandBar() public method

public UnregisterCommandBar ( ICommandBar commandBar ) : void
commandBar ICommandBar
return void

UnregisterCommandTargetVisitor() public method

Unregisters a command target visitor.
public UnregisterCommandTargetVisitor ( ICommandTargetVisitor visitor ) : void
visitor ICommandTargetVisitor /// The visitor. ///
return void

UnregisterGlobalHandler() public method

Unregisters a global handler.
public UnregisterGlobalHandler ( object handler ) : void
handler object /// The handler. ///
return void

VisitCommandTargets() public method

Visits the active command route
public VisitCommandTargets ( ICommandTargetVisitor visitor, object initialTarget ) : object
visitor ICommandTargetVisitor /// Visitor. ///
initialTarget object /// Initial target (provide null to use the default initial target) ///
return object