| Creating actions |
SDL Trados Studio Integration API provides support for the third party developers to implement actions inside the Studio desktop applications.
An action is a piece of code which can have a UI representation and is usually executed over a UI controller. Most of the time is used to allow user to execute an application specific functionality.
There are two kind of actions that can be created inside Studio applications:
For a sample on how to create a global context actions integrated into a custom ribbon group: Integrating actions
In order to create an action a third party developer will require the following steps:
For a sample on how to create actions see: Integrating actions
On how to obtain an already created action check and see: GetActionTAction |
The SDL Trados Studio Integration API provide support for third party developers to add keyboard shortcuts to the actions they implement.
In order to create a shortcut action a third party developer will require to decorate the action class with the ShortcutAttribute and specify the combination of keyboard keys on which the action should be triggered and executed.
You can see in the sample bellow how ALT+F8 is added as a shortcut key for the action.
[Action("MyMainIconAction", Icon = "MyAction_Icon")] [ActionLayout(typeof(MySampleRibbonGroup), 10, DisplayType.Large)] [Shortcut(Keys.Alt | Keys.F8)] public class MyMainIconAction : AbstractAction { protected override void Execute() { MessageBox.Show("My icon and shortcut key action sample."); } }
The shortcut keys that are in conflict with SDL shorcuts will have a lower priority and will be ignored. |