Click or drag to resize
Integrating actions

Desktop Integration Api provides support for the third party developers to integrate actions inside the SDL Studio desktop applications.

Integrating general actions

The following example demonstrates how to create an action into the Studio application which has a general purpose and integrate it into a custom ribbon group (see: Integrating ribbon groups).

C#
[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.");
    }
}
Integrating controller actions

The following example demonstrates how to create an action specific to a controller and integrate it into a custom ribbon group (see: Integrating ribbon groups).

C#
[Action("MyNormalSizeAction")]
[ActionLayout(typeof (MySampleRibbonGroup), DisplayType = DisplayType.Normal)]
public class MyNormalSizeAction : AbstractViewControllerAction<ProjectsController>
{
    protected override void Execute()
    {
        MessageBox.Show(string.Format("There are(is) {0} visible project(s) in the projects list",
                                      Controller.GetProjects().Count()));
    }
}

[Action("MyTopNormalSizeAction")]
[ActionLayout(typeof (MySampleRibbonGroup), 9, DisplayType.Normal)]
public class MyTopAction : AbstractViewControllerAction<EditorController>
{
    protected override void Execute()
    {
        MessageBox.Show(string.Format("There are(is) {0} document(s) opened in the editor",
                                      Controller.GetDocuments().Count()));
    }
}
Community
Edit

Be the first to Edit the community content of this topic.
Comments