AML.Editor.PluginContracts
The command arguments for the
Gets the captured image. If no image was captured, the value is null.
The command arguments for the
Some extension methods, which can be used to get access to the commanding interface of a PlugIn
Calls the command, to close the CAEX file.
The plug in.
The result.
true, if the operation has been executed successfully; false
if an Error exists or the operation has been cancelled. Interpret the result output for details.
Calls the command, to save the CAEX file.
The plug in.
The result.
true, if the operation has been executed successfully; false
if an Error exists or the operation has been cancelled. Interpret the result output for details.
Calls the command, to get the currently edited CAEX file from the AutomationML editor.
The plug in.
The result.
true, if the operation has been executed successfully; false
if an Error exists or no current file is loaded. Interpret the result output for details.
Calls the command, to capture the selected tree node and its visible descendants.
The plug in.
The result.
true, if the operation has been executed successfully; false
if an Error exists or no image has been created. Interpret the result output for details.
Calls the command, to open the CAEX file.
The plug in.
The file path.
The library names.
if set to true no user interaction is required.
The result.
true, if the operation has been executed successfully; false
if an Error exists or the operation has been cancelled. Interpret the result output for details.
Calls the command, to create a new CAEX file.
The plug in.
The result.
true, if the operation has been executed successfully; false
if an Error exists or the operation has been cancelled. Interpret the result output for details.
Calls the command, to open the CAEX file.
The plug in.
The file path.
The result.
true, if the operation has been executed successfully; false
if an Error exists or the operation has been cancelled. Interpret the result output for details.
Calls the command, to open the CAEX file from a stream.
The plug in.
The file content stream.
The result.
true, if the operation has been executed successfully; false
if an Error exists or the operation has been cancelled. Interpret the result output for details.
The available commands of the AMLEditor, which can be invoked by a PlugIn, implementing the
interface.
The close file command. Use this command with the callback arguments.
The command executes identical to the close command invoked from the File/Close menu item of the AutomationML
Editor.
Be aware, that this command is a User Interaction and may be cancelled by the user.
The save file command. Use this command with the callback arguments.
The command executes identical to the save command invoked from the File/Save menu item of the AutomationML Editor.
Be aware, that this command is a User Interaction and may be cancelled by the user.
The open file command. Use this command with the callback arguments.
The command executes nearly identical to the open command invoked from the File/Open menu item, except that
no open file browser dialogue is presented to the user.
Be aware, that this command may include a User Interaction (if a currently opened and modified file has not been
saved) and may be cancelled by the user.
The new file command. Use this command with the callback arguments.
The command executes identical to the close command invoked from the File/New menu item. The new file's CAEX schema
is set to the currently selected schema.
Be aware, that this command may include a User Interaction (if a currently opened and modified file has not been
saved) and may be cancelled by the user.
The get current CAEX file command. Use this command with the callback
arguments.
The command to insert AML libraries from an external file into the current document. Use this command with the
callback arguments.
The command executes nearly identical to the import from file command invoked from the File/ImportFromFile menu
item, except that
no selection dialogue is presented to the user, if the command mode is set to silent. In silent mode, libraries are
automatically transformed if a schema transformation is needed.
The command to capture an image from the selected tree node and its visible sub tree. Use this command with the
callback arguments.
The command executes nearly identical to the capture command provided by the editor except the save dialogue. The
created image is returned to the caller.
///
The command arguments for the
This delegate type defines the callback function, provided by the AMLEditor to a PlugIn, implementing the
interface.
The source PlugIn which calls the delegate.
The command which should be executed.
The command arguments.
This class defines the base command properties for an AMLEditor command.
Gets or sets the input arguments for a command. Specific access properties to the arguments array are provided by
the derived classes.
Gets or sets a value indicating whether an interactive operation has been canceled by the user.
The PlugIn application should check the Canceled property before accessing any properties in a class derived from
EditorCommandArguments;
otherwise, the property will raise an InvalidOperationException if the operation was aborted.
Gets a value indicating which error occurred during the operation.
If an exception is raised during an operation, the AutomationML editor will assign the exception to the Error
property.
The PlugIn application should check the Error property before accessing any properties in a class derived from
EditorCommandArguments;
otherwise, the property will raise a TargetInvocationException with its InnerException property holding a reference
to Error.
The value of the Error property is null if the operation was completed successful or canceled.
Gets the result of the command. Specific type conversions for this property are provided by the derived classes.
The command arguments for the
Gets the CAEX file of the current opened AML file. If no file is currently edited, the value is null.
This interface is a PlugIn interface, that provides a callback function, which can be used to execute commands
provided by the AMLEditor.
Property set by the AMLEditor to provide a callback function to a PlugIn, which can be used to execute an editor
command.
All available commands are listed in . The current implementation only supports
synchronous
execution of commands.
The command arguments for the
Initializes a new instance of the class.
Name of the file.
The library names.
if set to true the import command doesn't require a user interaction.
Gets the file path of the AML file, containing the libraries.
The file path.
Gets a value indicating whether the import command requires a user interaction.
true if this instance is silent; otherwise, false.
Gets the library names, which should be imported
The Aml.Editor.Plugin.Commanding name space contains a specific PlugIn Interface class to enable a PlugIn to call a
specific command of the AMLEditor using a callback function. Each command has an assigned command argument class,
which
should be used with the command.
The command arguments for the
The command arguments for the
Initializes a new instance of the class.
The file path, which defines the path to the file which should be opened in the editor.
Initializes a new instance of the class.
The file path, which defines the path to the file which should be opened in the editor.
Gets the file path for the Opened file.
Gets the file content as a stream for the Opened file.
The Aml.Editor.Plugin.Contracts.Base name space contains abstract Base Classes for AutomationML
Editor PlugIn Developers which implement some basic Functionality for PlugIns.
Example Implementations, that may be used as a starting point for PlugIn Development
are available on
the
Aml.Editor.Plugin
Project side for Developers.
To get a PlugIns loaded into the AutomationML Editor at startup the DLLs have to be put in the PlugIns
Folder in the Execution Directory of the Editor. Only the AutomationML Editor Version 4 and
higher supports 3d Party PlugIns. Every PlugIn shall use the same version of the Aml.Engine as the
used Aml.Editor version.
This enum defines the possible docking positions for a plugIn window, when it is layouted by the Editors
Docking manager.
The initial position is the left tabular docking pane
The initial position is the right tabular docking pane
The initial position is the bottom tabular docking pane
The initial position is the top tabular docking pane
The initial position is the content host containing also the library views
The initial position is the content host containing also the library views. The existing library views are set to
the maximized window.
The plugIn window is viewed as a floating window
This interface can be implemented by plugIns, which are used to view external data, referenced by external data
connectors in an AutomationML file or stream.
Gets a value indicating whether this PlugIn is an externals viewer. An external viewer is provided
with a selected external data source like a PLCopenXML document or a COLLADA document or any other
content. An external viewer can restrict itself to a specific MIME type .
If any external content is ready to be viewed, the AML Editors calls the
or
.
true if this instance is externals viewer; otherwise, false.
Gets the MIME type defining the content class, this viewer is able to handle. The AML editor looks at the
MIME type, found in the external reference or AutomationML container relation. As an example, the MIME type in
the is
set to "model/vnd.collada+xml".
This method is called by the AML editor if the PlugIn's property
returns true and the URI attribute references a file.
The attribute.
The file path.
This method is called by the AML editor if the PlugIn's property
returns true and the URI attribute references a stream in an AutomationML container.
The attribute.
The memory stream.
InterfaceClass for any AutomationML Editor PlugIn.
The AutomationML Editor is the Host Application for any PlugIn, which implements this interface.
The PlugIn implementing this interface will typically run it's own user interface thread. For an
integrated UI-PlugIn, which will be controlled by the AutomationML Editors Main UI-Thread the
-Interface Contract has to be used.
[ExportMetadata("Author", "...")]
[ExportMetadata("DisplayName", "HelloAml")]
[ExportMetadata("Description", "The 'HelloAml' is an AutomationML Editor plugin, which ....")]
[Export(typeof(IAMLEditorPlugin))]
public class HelloAml : IAMLEditorPlugin
{
}
The Event occurs when the PlugIn is Activated (for example via an Activation Command).
This event is raised by the PlugIn and handled by the AutomationML Editor. If the PlugIn
has a UI-Control, the AutomationML Editor will show the UI and dock the Control in a
Container Window, used for external Views.
Occurs when the PlugIn is terminated (some UserInteraction inside the PlugIn, i. e. a
Window is Closed, or via a Command). This event is raised by the PlugIn and handled by
the AutomationML Editor. If the PlugIn is a UI-Control , the
control is removed from the Container Window. The State of the currently open AutomationML
Document is checked, and if it was modified, the User will be asked to reload it.
Gets the Activation command for the PlugIn.
The activation command.
Gets the List of commands, which are bound to the PlugIn Menu in the AutomationML
Editor. The Command Names are shown in a sub-Menu in the PlugIn-Menu.
The commands.
Gets the display name which is shown in the PlugIn Menu in the AutomationML Editor.
The display name.
Gets a value indicating whether this instance is active.
true if this instance is active; otherwise, false.
Gets or sets a value indicating whether this instance is automatic active when loaded.
This value can be initially set and will be defined by the user.
true if this instance is automatic active; otherwise, false.
Gets a value indicating whether this instance is reactive. Reactive PlugIn will be
notified, when the actual CAEX-Object changes (Selection of any Tree view Item in an
AutomationML TreeView) via the Method or an
AutomationML File is opened via the Method.
true if this instance is reactive; otherwise, false.
Gets a value indicating whether this instance is read only. A Read only PlugIn should not
change any CAEX Objects.
true if this instance is read only; otherwise, false.
Gets the package name which is used to download the PlugIn package from a NuGet feed. If a Package name
is defined, the AMLEditor can update PlugIn packages independently from its own update cycle.
The package name.
Gets the Terminate command for the PlugIn.
The terminate command.
Changes the current amlFilePath. The Host Application will call this method when the
PlugIns Property is set to true and the Currently opened
AutomationML File changes in the AMLEditor Host Application.
The Path to the current AML File in the AML Editor.
Changes the selected object. The Host Application will call this method when the PlugIns
Property is set to true and the Current Selection changes in
the AMLEditor Host Application.
The selected CAEX - object.
This Method enables the AutomationML Editor to execute a command. Only those commands
are executable, which are identifiable via the .
The command identifier.
The FilePath of the currently loaded AMLDocument, if a CAEXDocument is loaded, otherwise null
or empty
// ...
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;
}
PublishAutomationMLFileAndObject after the PlugIn is activated. This Method is called by
the AutomationML Editor when the Event is handled. The
AutomationML Editor will send the actual Path of the AutomationML File and the actual
selected Object to the PlugIn, when an AutomationML File is currently open. If the
Activation happened, when no AutomationML File was opened so far, the PlugIn will be
informed as soon as this will happen, but only if the Flag is set to true.
The AML file path.
The selected CAEX Object.
// To Load the content of the AutomationML Document the AmlEngine can be used
var document = CAEXDocument.LoadFromFile (amlFilePath); ///
Interface which defines Metadata for an exported PlugIn.
Gets the name of the author.
Gets the name of the owner.
Gets the description of the PlugIn.
Gets the display name of the PlugIn.
The Interface IAMLEditorView is used for a PlugIn, which can be embedded in
the AutomationML Editor's Window- and Docking-Manager. The PlugIn must implement the
IFrameworkInputElement Interface (as an example, a WPF UserControl) and
the Interface. For windows, based on ,
the view must have a wrapper.
[ExportMetadata("Author", "...")]
[ExportMetadata("DisplayName", "HelloAml")]
[ExportMetadata("Description", "The 'HelloAml' is an AutomationML Editor plugin, which ....")]
[Export(typeof(IAMLEditorView))]
public partial class HelloAml : System.Windows.Control.UserControl, IAMLEditorView
{
}
Gets a value indicating whether this PlugIn Instance can close. If set to true,
the PlugIn may be closed from the AutomationML Docking Manger Window Menu or the
Windows Close Button.
true if this instance can close; otherwise, false.
Gets the initial dock position for the PlugIn window
Gets the image which should be used in the Header of the PlugIn window. If no image is defined the editor uses a
default image.
The Interface IAMLEditorViewCollection is used for a PlugIn, which can be embedded in
the AutomationML Editor's Window- and Docking-Manager. This PlugIn can provide
multiple independent views, to be embedded at different positions in the AML Editor where
each of the views shall implement the interface.
It is possible to dynamically add and remove views from the collection while the PlugIn is
active.
The individual views in this collection shall not export themselves as PlugIns because
the Activation and Termination is handled by this collection PlugIn for all views in the
list as a whole.
[ExportMetadata("Author", "...")]
[ExportMetadata("DisplayName", "MultiWindowPlugin")]
[ExportMetadata("Description", "The 'MultiWindowPlugin' is an AutomationML Editor plugin, which ....")]
[Export(typeof(IAMLEditorViewCollection))]
public partial class MultiWindowPlugin : List<IAMLEditorView>
{
}
The Event occurs when a view has been added to this collection. The AML editor will handle this event and
will dock the added view at the dock position, defined by the view.
This PlugIn interface can be implemented to get notifications when an AML document
is loaded or unloaded by the AutomationML editor.
Occurs when the PlugIn has loaded a new document, which should be loaded into the AutomationML editor for editing.
Method called by the AutomationML editor, when the editor application is closed.
Method called by the AutomationML editor, when a document is loaded.
The loaded document
Method called by the AutomationML editor, when the current document is unloaded.
This PlugIn interface can be implemented to get notifications when an AML document
is saved by the AutomationML editor.
Method called by the AutomationML editor, when the editor saved a document
This interfaces is used to implement a PlugIn which will receive a notification with the
method called, when the AMLEditor activates a view.
Is called, when the AMLEditor activates a view.
Name of the activated view. This is the display name shown in the view tab header.
This interface can be implemented by a PlugIn to get the AutomationML editor to notify
the plugin when the UI zoom factor changes.
The event which is raised when an element should be selected.
Supported application themes of the AML Editor.
The default theme
The office2010 blue theme
The office2013 theme
The metro theme
The royal light theme
No theme defined
This interface can be implemented by a PlugIn which needs a notification when the editor
theme changes.
Called when the editors theme changes.
Name of the theme.
This interface can be implemented by a PlugIn to get the AutomationML editor to select a
CAEX element in a tree view when the event is raised.
The event which is raised when an element should be selected.
The event arguments for the selection event .
Creates an instance of the for the
specified .
This element should be selected by the AutomationML editor.
The element to select.
This interface can be implemented by PlugIns which provide , integrated into the
AMLEditors tool bar.
Gets the commands to be integrated into the tool bar. The commands shall specify an image source for the tool bar
button.
The Aml.Editor.Plugin.Contracts Namespace contains Classes and Interfaces for AutomationML
Editor PlugIn Developers. The Interface Classes should be used as MEF Contracts, that
matches Import and Export components, defined by Import and Export Attributes, at runtime.
An AutomationML Editor PlugIn will export the components, implementing the Interfaces in the
Contract DLL and the AutomationML Editor imports those components. The Contracts DLL is
managed on nuget.
All PlugIns which export an interface are loaded into the AutomationML Editor at startup
only. If the AutomationML Editor restarts after a crash, no PlugIns are loaded, because the
crash may be caused by a PlugIn. To get a PlugIn loaded, the DLLs have to be in the PlugIns
Folder in the Execution Directory of the Editor. Only the AutomationML Editor Version 4 and
higher supports 3d Party PlugIns.
Class PluginCommand is used to publish Commands from a PlugIn to the AutomationML Editor.
Since version 2.2.0 the PluginCommand implements the ICommand interface. The
AutomationML Editor > v5.1.3 binds UI commanding elements directly to this instance and
not to the property. The Execution methods defined by the
command property are indirectly called. This allows the PluginCommand to catch exceptions of
Command execution.
Initializes a new instance of the class.
The DoNothing - Command
Occurs when a property value changes
Occurs when changes occur that affect the execution of the command
Gets or sets the command, as an example a . A Command
Parameter is set to the FilePath of the Active AMLDocument if a document is loaded,
otherwise it is null or empty.
The command.
Gets or sets the command icon which should be used, if the command is bound to a button control.
Gets or sets the button content which should be used, if the command is bound to a button control.
This is an alternative to the property if the button content is not an icon
but any content. The content will be loaded to the Button using a content presenter.
Gets or sets the name of the command used by the AutomationML Editor to show the Command
in the PlugIn Menu
The name of the command.
Gets or sets the command tool tip
The command tool tip.
Gets the display name (This returns only the ).
A DisplayName Property is needed to bind the CommandName to UI controls.
Gets or sets a value indicating whether this instance is a checkable command. Checkable
Commands get a Check Box in the MenuItem
true if this instance is checkable command; otherwise, false.
Gets or sets a value indicating whether this instance is a toggle command. Toggle
Commands get a Check Box in the MenuItem
true if this instance is toggle command; otherwise, false.
Test, if the can execute.
TODO The parameter.
true, if command can execute
The Execution Action.
TODO The parameter.
Called when [property changed].
Name of the property.
Enumeration Constants for Plugin Commands. This Constants are used in the Host AutomationML Editor Application
to Execute a Plugin internal command. The Plugin should at least publish these commands to the Host via its command
list.
Identifies the activate command
Identifies the terminate command
Class RelayCommand as it was defined in an MSDN Article
by Josh Smith.
This class is an implementation pattern for a plugin command, which the AutomationML Editor
can bind to a plugin Menu. This Implementation provides the UI with the state information, to enabled or disable a
command, and with the
invocation Method.
Type of Command Data (this may be the System type 'object')
Gets or sets the identifier for the command, when the command is published by the plugin
class, the Identifier can be set as an
The identifier.
Occurs, when property changes are notified, which have an effect on the command execution.
The _can execute
The _execute
Initializes a new instance of the class.
Creates a new command.
The execution logic.
The execution status logic.
execute
Defines the method used to determine whether the command in the current state can be performed.
Data used from the command. When the command does not require data transfer, the object
can be set to null.
true, if the command can be executed, otherwise false.
Defines the method that will be called when the command is invoked.
Data used from the command. When the command does not require data transfer, the object
can be set to null.
PluginBase is an abstract base class for PlugIn Implementation which is a basic implementation of the
PlugIn Interface
The Display name
The PlugIn commands which are shown in the PlugIn Menu.
Initializes a new instance of the class which contains the two PlugIn Commands
and which every PlugIn should have.
The Event occurs when the PlugIn is Activated (for example via an Activation Command).
This event is raised by the PlugIn and handled by the AutomationML Editor. If the PlugIn
has a UI-Control, the AutomationML Editor will show the UI and dock the Control in a
Container Window, used for external Views.
Occurs when the PlugIn is terminated (some UserInteraction inside the PlugIn, i. e. a
Window is Closed, or via a Command). This event is raised by the PlugIn and handled by
the AutomationML Editor. If the PlugIn is a UI-Control , the
control is removed from the Container Window. The State of the currently open AutomationML
Document is checked, and if it was modified, the User will be asked to reload it.
Gets the Activation command for the PlugIn.
The activation command.
Gets the List of commands, which are bound to the PlugIn Menu in the AutomationML
Editor. The Command Names are shown in a sub-Menu in the PlugIn-Menu.
The commands.
Gets the display name which is shown in the PlugIn Menu in the AutomationML Editor.
The display name.
Gets a value indicating whether this instance is active.
true if this instance is active; otherwise, false.
Gets or sets a value indicating whether this instance is automatic active when loaded.
This value can be initially set and will be defined by the user.
true if this instance is automatic active; otherwise, false.
Gets a value indicating whether this instance is reactive. Reactive PlugIn will be
notified, when the actual CAEX-Object changes (Selection of any Tree view Item in an
AutomationML TreeView) via the Method or an
AutomationML File is opened via the Method.
true if this instance is reactive; otherwise, false.
Gets a value indicating whether this instance is read only. A Read only PlugIn should not
change any CAEX Objects.
true if this instance is read only; otherwise, false.
Gets the package name which is used to download the PlugIn package from a NuGet feed. If a Package name
is defined, the AMLEditor can update PlugIn packages independently from its own update cycle.
The package name.
Gets the Terminate command for the PlugIn.
The terminate command.
Changes the current amlFilePath. The Host Application will call this method when the
PlugIns Property is set to true and the Currently opened
AutomationML File changes in the AMLEditor Host Application.
The Path to the current AML File in the AML Editor.
Changes the selected object. The Host Application will call this method when the PlugIns
Property is set to true and the Current Selection changes in
the AMLEditor Host Application.
The selected CAEX - object.
This Method enables the AutomationML Editor to execute a command. Only those commands
are executable, which are identifiable via the .
The command identifier.
The FilePath of the currently loaded AMLDocument, if a CAEXDocument is loaded, otherwise null
or empty
// ...
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;
}
PublishAutomationMLFileAndObject after the PlugIn is activated. This Method is called by
the AutomationML Editor when the Event is handled. The
AutomationML Editor will send the actual Path of the AutomationML File and the actual
selected Object to the PlugIn, when an AutomationML File is currently open. If the
Activation happened, when no AutomationML File was opened so far, the PlugIn will be
informed as soon as this will happen, but only if the Flag is set to true.
The AML file path.
The selected CAEX Object.
// To Load the content of the AutomationML Document the AmlEngine can be used
var document = CAEXDocument.LoadFromFile (amlFilePath);
Test, if the can execute.
parameter may contain the FilePath of the Active AMLDocument if a document is loaded,
otherwise it is null or empty
true, if command can execute
The Execution Action. The Property is set to true and
the Event is raised.
parameter may contain the FilePath of the Active AMLDocument if a document is loaded,
otherwise it is null or empty
Raises the PlugIn activated.
Raises the PlugIn terminated.
Test, if the can execute.
parameter may contain the FilePath of the Active AMLDocument if a document is loaded,
otherwise it is null or empty
true, if command can execute
The Execution Action. The Property is set to false and
the Event is raised.
parameter may contain the FilePath of the Active AMLDocument if a document is loaded,
otherwise it is null or empty