Show TOC

List<AddInCommand> GetCustomCommands();Locate this document in the navigation structure

Defines the behavior of the custom buttons defined in method List < EpmRibbonAction > GetRibbonComponents();, meaning when the buttons are displayed and when they are enabled.

Caution To be able to add an action to a custom button, each custom button must be linked to an AddInCommand in the method GetCustomCommands.
Example
public List<AddInCommand> GetCustomCommands()
   {
				List<AddInCommand> commands = newList<AddInCommand>();
      commands.Add(newAddInCommand(PlusButton, AddInState.HasActiveConnection | AddInState.ActiveDocumentIsInputable));
						commands.Add(newAddInCommand(StarButton, AddInState.HasActiveConnection));
					 commands.Add(newAddInCommand(RecordButton, AddInState.HasActiveConnection, AddInState.HasActiveConnection));
 return commands;
 }
Example explained

The method returns the following list of actions:

These actions create a list of commands for the EPM plug-in.

public List<AddInCommand> GetCustomCommands()
 {
 List<AddInCommand>
commands = newList<AddInCommand>(); 

The PlusButton is enabled only if the current worksheet of the EPM plug-in is connected and is an input form (when the "Use as Input Form" option is selected).

 commands.Add(newAddInCommand(PlusButton, AddInState.HasActiveConnection | AddInState.ActiveDocumentIsInputable));
The StarButton is enabled only when the EPM plug-in is connected.
 commands.Add(newAddInCommand(StarButton, AddInState.HasActiveConnection));
The RecordButton button is displayed and enabled only when the EPM plug-in is connected.
commands.Add(newAddInCommand(RecordButton, AddInState.HasActiveConnection, AddInState.HasActiveConnection));
 return commands;
 }