IApplicationComponent Interface
The Innovator framework uses the IApplicationComponent interface for sending messages to the plug-in.
Realizing the Interface
A plug-in must contain precisely one class that realizes the IApplicationComponent. The Innovator framework uses the class for sending messages to the plug-in if relevant events are triggered. The framework creates an instance of the class when opening an Innovator model. This instance exists throughout the lifecycle of the model and is used for all messages which are triggered in the context of this model.
Note: The plug-in itself never instantiates its own interface realization class.
IApplicationComponent.Description
The Description property is used for describing plug-ins.
ComponentDescription Description { get; }
The ComponentDescription class contains the following properties:
-
Purpose
Purpose of the plug-in
Note: The Description property is not currently evaluated and is planned for future use.
IApplicationComponent.RequestHandler
RequestHandler is the IApplicationComponent interface's central method which processes incoming messages from the framework.
void RequestHandler(ModelDockSite, Request)
-
ModelDockSite
Model context that contains all relevant data about the model and window the model is shown in.
-
Request
Message sent from the framework. The Type property specifies the event that lead to the message being sent.
The elementary message types are described in more detail below:
Check
Each plug-in gets a message from the Check type immediately upon user login to the model. A plug-in should verify whether it can be run with the model upon edit. If the model does not fulfill the necessary prerequisites, then the plug-in should deliver a significant message in the Error property in the Request structure as a result. The plug-in is then not loaded and remains inactive throughout the Innovator interface runtime. It is not possible to load the plug-in at a later stage.
Note: A plug-in that can be executed in all circumstances does not need to process the message.
Note
See the MID.Innovator.Plugin.Sample.CheckRequest sample for editing the Check message.
OpenModel
If the plug-in was not deactivated when the Check message was being edited, then it gets an OpenModel message. The only option to extend the interface is by:
-
Registering your own commands
-
Creating additional control elements in the ribbon
-
Creating your own tool window
