Skip to content

M_Aml_Editor_Plugin_Base_PluginBase_ExecuteCommand

AutomationML edited this page Jun 24, 2019 · 1 revision

PluginBase.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.Base
Assembly: AML.Editor.PluginContracts (in AML.Editor.PluginContracts.dll) Version: 2.1

Syntax

C#

public virtual void ExecuteCommand(
	PluginCommandsEnum command,
	string amlFilePath
)

VB

Public Overridable Sub ExecuteCommand ( 
	command As PluginCommandsEnum,
	amlFilePath As String
)

C++

public:
virtual 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

Implements

IAMLEditorPlugin.ExecuteCommand(PluginCommandsEnum, String)

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

PluginBase Class
Aml.Editor.Plugin.Base Namespace

Clone this wiki locally