-
Notifications
You must be signed in to change notification settings - Fork 260
CommandService Component
A command is an action that is invoked from a menu item or tool strip button. You can create menus, menu items, and tool strip buttons and associate them with commands. The command specifies its appearance and behavior in the UI: text, icon, keyboard shortcut, and actual command action.
CommandService creates standard menus, displays the currently available application commands to the user in menus and tool strips, displays context menus, and processes keyboard shortcuts.
This component, or one like it, is useful to any application that activates commands through menus and tool strips and is used by nearly all the ATF samples. Because it is a component, applications simply need to add CommandService to the MEF TypeCatalog. The ATF standard command components, such as StandardEditCommands or StandardFileCommands, require CommandService to work. In fact, if you left out CommandService, your application would have no menus at all, unless you added them some other way.
For WinForms, applications also need to use the StatusService and SettingsService components, because CommandService imports IStatusService and ISettingsService.
For more information on satisfying components' import needs, see Using ATF Components.
CommandService implements the ICommandService interface. ICommandService offers methods similar to IControlHostService. ICommandService offers methods to register and unregister menus and commands, instead of controls. The related interface ICommandClient contains methods to determine whether a command can be performed, update the command's menu, and actually perform the command.
There are versions of CommandService and ICommandService for both WinForms and WPF.
For more information about CommandService and commands, see Commands in ATF. For information on using CommandService, see CommandService.
ATF Application Basics and Services
-
WinForms Application: Show a
Main()function pattern common in WinForms application ATF samples and what it accomplishes. - WPF Application: Discuss how WPF applications differ from WinForms ones in basic application structure.
- ControlHostService Component: This component is responsible for exposing client Controls in the application's main form.
- CommandService Component: Show the basics of supporting commands in ATF.
- SettingsService Component: This component manages preferences and their persistence.
- StatusService Component: Show how to use this component to display status messages.
- Other ATF Services: Describe other services: document management, file dialogs, Help dialog, and resources.
- Home
- Getting Started
- Features & Benefits
- Requirements & Dependencies
- Gallery
- Technology & Samples
- Adoption
- News
- Release Notes
- ATF Community
- Searching Documentation
- Using Documentation
- Videos
- Tutorials
- How To
- Programmer's Guide
- Reference
- Code Samples
- Documentation Files
© 2014-2015, Sony Computer Entertainment America LLC