C# 클래스 Catel.MVVM.CommandManager

Manager that takes care of application-wide commands and can dynamically forward them to the right view models.
상속: ICommandManager
파일 보기 프로젝트 열기: Catel/Catel 1 사용 예제들

공개 메소드들

메소드 설명
CommandManager ( ) : System

Initializes a new instance of the CommandManager class.

CreateCommand ( string commandName, Catel.Windows.Input.InputGesture inputGesture = null, ICompositeCommand compositeCommand = null, bool throwExceptionWhenCommandIsAlreadyCreated = true ) : void

Creates the command inside the command manager. If the throwExceptionWhenCommandIsAlreadyCreated is false and the command is already created, only the input gesture is updated for the existing command.

CreateCommand ( string commandName, ICompositeCommand compositeCommand = null, bool throwExceptionWhenCommandIsAlreadyCreated = true ) : void

Creates the command inside the command manager.

ExecuteCommand ( string commandName ) : void

Executes the command.

GetCommand ( string commandName ) : ICommand

Gets the command created with the command name.

GetCommands ( ) : IEnumerable

Gets all the registered commands.

GetInputGesture ( string commandName ) : Catel.Windows.Input.InputGesture

Gets the input gesture for the specified command.

GetOriginalInputGesture ( string commandName ) : Catel.Windows.Input.InputGesture

Gets the original input gesture with which the command was initially created.

InvalidateCommands ( ) : void

Invalidates the all the currently registered commands.

IsCommandCreated ( string commandName ) : bool

Determines whether the specified command name is created.

RegisterAction ( string commandName, System.Action action ) : void

Registers the action with the specified command name.

RegisterAction ( string commandName, Action action ) : void

Registers the action with the specified command name.

RegisterCommand ( string commandName, ICommand command, IViewModel viewModel = null ) : void

Registers a command with the specified command name.

ResetInputGestures ( ) : void

Resets the input gestures to the original input gestures with which the commands were registered.

SubscribeToKeyboardEvents ( ) : void

Subscribes to keyboard events.

SubscribeToKeyboardEvents ( FrameworkElement view ) : void

Subscribes to keyboard events.

UnregisterAction ( string commandName, System.Action action ) : void

Unregisters the action with the specified command name.

UnregisterAction ( string commandName, Action action ) : void

Unregisters the action with the specified command name.

UnregisterCommand ( string commandName, ICommand command ) : void

Unregisters a command with the specified command name.

UpdateInputGesture ( string commandName, Catel.Windows.Input.InputGesture inputGesture = null ) : void

Updates the input gesture for the specified command.

비공개 메소드들

메소드 설명
OnWindowLoaded ( object sender, RoutedEventArgs e ) : void

메소드 상세

CommandManager() 공개 메소드

Initializes a new instance of the CommandManager class.
public CommandManager ( ) : System
리턴 System

CreateCommand() 공개 메소드

Creates the command inside the command manager. If the throwExceptionWhenCommandIsAlreadyCreated is false and the command is already created, only the input gesture is updated for the existing command.
The is null or whitespace. The specified command is already created using the method.
public CreateCommand ( string commandName, Catel.Windows.Input.InputGesture inputGesture = null, ICompositeCommand compositeCommand = null, bool throwExceptionWhenCommandIsAlreadyCreated = true ) : void
commandName string Name of the command.
inputGesture Catel.Windows.Input.InputGesture The input gesture.
compositeCommand ICompositeCommand The composite command. If null, this will default to a new instance of .
throwExceptionWhenCommandIsAlreadyCreated bool if set to true, this method will throw an exception when the command is already created.
리턴 void

CreateCommand() 공개 메소드

Creates the command inside the command manager.
The is null or whitespace. The specified command is already created using the method.
public CreateCommand ( string commandName, ICompositeCommand compositeCommand = null, bool throwExceptionWhenCommandIsAlreadyCreated = true ) : void
commandName string Name of the command.
compositeCommand ICompositeCommand The composite command. If null, this will default to a new instance of .
throwExceptionWhenCommandIsAlreadyCreated bool if set to true, this method will throw an exception when the command is already created.
리턴 void

ExecuteCommand() 공개 메소드

Executes the command.
The is null or whitespace. The specified command is not created using the method.
public ExecuteCommand ( string commandName ) : void
commandName string Name of the command.
리턴 void

GetCommand() 공개 메소드

Gets the command created with the command name.
The is null or whitespace.
public GetCommand ( string commandName ) : ICommand
commandName string Name of the command.
리턴 ICommand

GetCommands() 공개 메소드

Gets all the registered commands.
public GetCommands ( ) : IEnumerable
리턴 IEnumerable

GetInputGesture() 공개 메소드

Gets the input gesture for the specified command.
The specified command is not created using the method.
public GetInputGesture ( string commandName ) : Catel.Windows.Input.InputGesture
commandName string Name of the command.
리턴 Catel.Windows.Input.InputGesture

GetOriginalInputGesture() 공개 메소드

Gets the original input gesture with which the command was initially created.
The specified command is not created using the method.
public GetOriginalInputGesture ( string commandName ) : Catel.Windows.Input.InputGesture
commandName string Name of the command.
리턴 Catel.Windows.Input.InputGesture

InvalidateCommands() 공개 메소드

Invalidates the all the currently registered commands.
public InvalidateCommands ( ) : void
리턴 void

IsCommandCreated() 공개 메소드

Determines whether the specified command name is created.
The is null or whitespace.
public IsCommandCreated ( string commandName ) : bool
commandName string Name of the command.
리턴 bool

RegisterAction() 공개 메소드

Registers the action with the specified command name.
The is null or whitespace. The is null. The specified command is not created using the method.
public RegisterAction ( string commandName, System.Action action ) : void
commandName string Name of the command.
action System.Action The action.
리턴 void

RegisterAction() 공개 메소드

Registers the action with the specified command name.
The is null or whitespace. The is null. The specified command is not created using the method.
public RegisterAction ( string commandName, Action action ) : void
commandName string Name of the command.
action Action The action.
리턴 void

RegisterCommand() 공개 메소드

Registers a command with the specified command name.
The is null or whitespace. The is null. The specified command is not created using the method.
public RegisterCommand ( string commandName, ICommand command, IViewModel viewModel = null ) : void
commandName string Name of the command.
command ICommand The command.
viewModel IViewModel The view model.
리턴 void

ResetInputGestures() 공개 메소드

Resets the input gestures to the original input gestures with which the commands were registered.
public ResetInputGestures ( ) : void
리턴 void

SubscribeToKeyboardEvents() 공개 메소드

Subscribes to keyboard events.
public SubscribeToKeyboardEvents ( ) : void
리턴 void

SubscribeToKeyboardEvents() 공개 메소드

Subscribes to keyboard events.
The is null.
public SubscribeToKeyboardEvents ( FrameworkElement view ) : void
view System.Windows.FrameworkElement The view.
리턴 void

UnregisterAction() 공개 메소드

Unregisters the action with the specified command name.
The is null or whitespace. The is null. The specified command is not created using the method.
public UnregisterAction ( string commandName, System.Action action ) : void
commandName string Name of the command.
action System.Action The action.
리턴 void

UnregisterAction() 공개 메소드

Unregisters the action with the specified command name.
The is null or whitespace. The is null. The specified command is not created using the method.
public UnregisterAction ( string commandName, Action action ) : void
commandName string Name of the command.
action Action The action.
리턴 void

UnregisterCommand() 공개 메소드

Unregisters a command with the specified command name.
The is null or whitespace. The is null. The specified command is not created using the method.
public UnregisterCommand ( string commandName, ICommand command ) : void
commandName string Name of the command.
command ICommand The command.
리턴 void

UpdateInputGesture() 공개 메소드

Updates the input gesture for the specified command.
The is null or whitespace. The specified command is not created using the method.
public UpdateInputGesture ( string commandName, Catel.Windows.Input.InputGesture inputGesture = null ) : void
commandName string Name of the command.
inputGesture Catel.Windows.Input.InputGesture The new input gesture.
리턴 void