Skip to content

Using Standard Command Components

gstaas edited this page Nov 24, 2014 · 6 revisions

ATF provides components that add commands commonly used in applications.

To use one of these components, do the following:

  1. Add the component to the MEF type catalog, as described in How MEF is Used in ATF.
  2. Add the CommandService component to the MEF type catalog that provides services for commands. For a discussion of why CommandService is required, see Functionality Required From Other Components.
  3. Provide whatever else the component needs, which may be other other components, or exporting and implementing an interface. For details on what individual components need, see Details on Using Selected ATF Components.

For a general discussion of how to use ATF components, see Using ATF Components.

These command components handle all the command registration, so you only need to implement the command clients. For details, see Creating Command Clients.

Each of these components is used in at least one sample.

The following table shows the ATF components that add standard commands and the commands they add. The "Added Command" column contains the StandardCommand enum for the command unless marked with an asterisk "*", in which case it is an enum internal to the defining class.

Component Component purpose Menu Added
Menu Item
Added Command
(StandardCommand)
Command Function
DefaultTabCommands Provide default commands related to document tab controls Context menu Close *CloseCurrentTab Close the current Tab panel
Close All But This *CloseOtherTabs Close all but the current Tab panel
Copy Full Path *CopyFullPath Copy the file path for the tab's document
Open Containing Folder *OpenContainingFolder Open the folder containing the tab's document in Windows® Explorer
HelpAboutCommand Display a dialog box with a description of the application Help About HelpAbout Display information about the application
PropertyEditingCommands Provide property editing commands that can be used inside PropertyGrid-like controls, such as property editors Context menu Reset Current *ResetCurrent Reset the current property to its default value
Reset All *ResetAll Reset all properties to their default values
Copy Property *Copy Copy this property's value to the clipboard
Paste Property *Paste Paste the clipboard into this property's value
View In Text Editor *ViewInTextEditor Open the file in the associated text editor
RecentDocumentCommands Provide menu commands to open and pin recent documents File Document name Open the document named in menu item
File Pin active document name *Pin Pin the active document to the recently used list
RenameCommand Define a mass rename command Edit Rename... *Rename Rename selected objects
SourceControlCommands Implement source control commands File > Source Control Enable *Enabled Enable source control
Open Connection... *Connection Open the source control connection
Add *Add Add to source control
Check In *CheckIn Check in to source control
Check Out *CheckOut Check out from source control
Get Latest Version *Sync Get latest version from source control
Revert *Revert Revert add or check out from source control
Refresh Status Refresh Refresh status in source control
Reconcile Offline Work... *Reconcile Reconcile offline work
StandardEditCommands Implement standard Edit menu commands. For more information, see StandardEditCommands and Instancing. Edit Cut EditCut Cut the selection and place it on clipboard
Copy EditCopy Copy the selection and place it on clipboard
Paste EditPaste Paste the contents of clipboard and make that the new selection
Delete EditDelete Delete the selection
StandardEditHistoryCommands Implement standard Edit Undo and Redo commands Edit Undo EditUndo Undo the last change
Redo EditRedo Redo the last edit
StandardFileCommands Add standard file commands. For more information, see StandardFileCommands Component File Save FileSave Save the active file.
Save As ... FileSaveAs Save the active file under a new name
Save All FileSaveAll Save all open files
Close FileClose Close the active file
StandardFileExitCommand Add File > Exit command that closes application's main form File Exit FileExit Exit the application
StandardLayoutCommands Provide standard layout commands Format > Align Lefts FormatAlignLefts Align left sides of selected items
Format > Align Tops FormatAlignTops Align tops of selected items
Format > Align Rights FormatAlignRights Align right sides of selected items
Format > Align Centers FormatAlignCenters Align centers of selected items
Format > Align Bottoms FormatAlignBottoms Align bottoms of selected items
Format > Align Middles FormatAlignMiddles Align middles of selected items
Format > Size Make Widths Equal FormatMakeWidthEqual Make selected items have the same width
Format > Size Make Heights Equal FormatMakeHeightEqual Make selected items have the same height
Format > Size Make Equal FormatMakeSizeEqual Make selected items have the same size
StandardLockCommands Implement standard Lock and Unlock commands Edit Lock EditLock Lock the selection to disable editing
Unlock EditUnlock Unlock the selection to enable editing
StandardPrintCommands Implement standard printing commands Print Print... Print Print the active document
Page Setup... FilePageSetup Set up page for printing
Print Preview... FilePrintPreview Show a print preview of the active document
StandardSelectionCommands Implement standard selection commands Edit Select All EditSelectAll Select all items
Deselect All EditDeselectAll Deselect all items
Invert Selection EditInvertSelection Select unselected items and deselect selected items
StandardShowCommands Implement standard Show commands View Hide ViewHide Hide all selected objects
Show ViewShow Show all selected objects
Show Last Hidden ViewShowLast Show the last hidden object
Show All ViewShowAll Show all hidden objects
Isolate ViewIsolate Show only the selected objects and hide all others
StandardViewCommands Implement standard viewing commands View Frame Selection ViewFrameSelection Frame all selected objects in the current view
Frame All ViewFrameAll Frame all objects in the current view
TargetCommands Commands to operate on currently selected targets Context menu Edit Vita Target in Neighborhood VitaNeighborhood Edit PlayStation®Vita Target in Neighborhood
Add New TTT Add New TTT Create a new target of type TTT
Remove TTT Remove TTT Remove selected target of type TTT
WindowLayoutServiceCommands Provide menu options and GUIs for managing and using layouts Window Layouts > Save Layout As... *SaveLayoutAs Save layout in selected file
Layouts > Manage Layouts... ManageLayouts Display Manage Layouts dialog

Topics in this section

Clone this wiki locally