Skip to content

M_Aml_Editor_Plugin_Contracts_IAMLEditorPlugin_ExecuteCommand

AutomationML edited this page Jun 24, 2019 · 1 revision

IAMLEditorPlugin.ExecuteCommand Method

AutomationML Editor

This Method enables the AutomationML Editor to execute a command. Only those commands are executable, which are identifiable via the PluginCommandsEnum.

Namespace: Aml.Editor.Plugin.Contracts
Assembly: AML.Editor.PluginContracts (in AML.Editor.PluginContracts.dll) Version: 2.1

Syntax

C#

void ExecuteCommand(
	PluginCommandsEnum command,
	string amlFilePath
)

VB

Sub ExecuteCommand ( 
	command As PluginCommandsEnum,
	amlFilePath As String
)

C++

void ExecuteCommand(
	PluginCommandsEnum command, 
	String^ amlFilePath
)

Parameters

 

command
Type: Aml.Editor.Plugin.Contracts.PluginCommandsEnum
The command identifier.
amlFilePath
Type: System.String
The FilePath of the currently loaded AMLDocument, if a CAEXDocument is loaded, otherwise null or empty

Examples

// ...
switch (command)
   {
       case PluginCommandsEnum.Activate:
           // activation code;
           // call your ActivateCommand execution method

           ActivateCommand.Execute (amlFilePath);
           break;

       case PluginCommandsEnum.Terminate:

           // termination code;
           // call your TerminateCommand execution method
           // the Execution Method of the PlugIn may save the changes of the AMLDocument if it was edited by the plugIn.
           // It should raise the PluginTerminated Event. This Event is handled by the AMLEditor, the Editor will
           // check, if the Document was modified and ask the user to reload the document. The Editor will also return
           // to editing mode if it was disabled during activation.

           TerminateCommand.Execute (amlFilePath);
           break;
   }

See Also

Reference

IAMLEditorPlugin Interface
Aml.Editor.Plugin.Contracts Namespace

Clone this wiki locally