C# Class EAScriptAddin.EAScriptAddinAddinClass

Description of MyClass.
Inheritance: EAAddinFramework.EAAddinBase
Show file Open project: GeertBellekens/Enterprise-Architect-Toolpack Class Usage Examples

Private Properties

Property Type Description
callFunctions bool
callFunctions long
callFunctions object
callFunctions string
resetScripts void
showSettings void

Public Methods

Method Description
EAScriptAddinAddinClass ( ) : System

constructor

EA_Disconnect ( ) : void

The EA_Disconnect event enables the Add-In to respond to user requests to disconnect the model branch from an external project. This function is called when the Enterprise Architect closes. If you have stored references to Enterprise Architect objects (not particularly recommended anyway), you must release them here. In addition, .NET users must call memory management functions as shown below: GC.Collect(); GC.WaitForPendingFinalizers(); Also look at EA_Connect.

EA_FileClose ( EA Repository ) : void

The EA_FileClose event enables the Add-In to respond to a File Close event. When Enterprise Architect closes an opened Model file, this event is raised and passed to all Add-Ins implementing this method. This event occurs when the model currently opened within Enterprise Architect is about to be closed (when another model is about to be opened or when Enterprise Architect is about to shutdown). Also look at EA_FileOpen and EA_FileNew.

EA_FileNew ( EA Repository ) : void

The EA_FileNew event enables the Add-In to respond to a File New event. When Enterprise Architect creates a new model file, this event is raised and passed to all Add-Ins implementing this method. The event occurs when the model being viewed by the Enterprise Architect user changes, for whatever reason (through user interaction or Add-In activity). Also look at EA_FileClose and EA_FileOpen.

EA_FileOpen ( EA Repository ) : void

The EA_FileOpen event enables the Add-In to respond to a File Open event. When Enterprise Architect opens a new model file, this event is raised and passed to all Add-Ins implementing this method. The event occurs when the model being viewed by the Enterprise Architect user changes, for whatever reason (through user interaction or Add-In activity). Also look at EA_FileClose and EA_FileNew.

EA_GetCompartmentData ( EA Repository, string sCompartment, string sGUID, EA oType ) : object

This event occurs when Enterprise Architect is instructed to redraw an element. It requests that the Add-In provide the data to populate the element's compartment.

EA_GetMenuItems ( EA Repository, string MenuLocation, string MenuName ) : object

The EA_GetMenuItems event enables the Add-In to provide the Enterprise Architect user interface with additional Add-In menu options in various context and main menus. When a user selects an Add-In menu option, an event is raised and passed back to the Add-In that originally defined that menu option. This event is raised just before Enterprise Architect has to show particular menu options to the user, and its use is described in the Define Menu Items topic. Also look at: - EA_MenuClick - EA_GetMenuState.

EA_GetMenuState ( EA Repository, string MenuLocation, string MenuName, string ItemName, bool &IsEnabled, bool &IsChecked ) : void

The EA_GetMenuState event enables the Add-In to set a particular menu option to either enabled or disabled. This is useful when dealing with locked packages and other situations where it is convenient to show a menu option, but not enable it for use. This event is raised just before Enterprise Architect has to show particular menu options to the user. Its use is described in the Define Menu Items topic. Also look at EA_GetMenuItems.

EA_MenuClick ( EA Repository, string MenuLocation, string MenuName, string ItemName ) : void

EA_MenuClick events are received by an Add-In in response to user selection of a menu option. The event is raised when the user clicks on a particular menu option. When a user clicks on one of your non-parent menu options, your Add-In receives a MenuClick event, defined as follows: Sub EA_MenuClick(Repository As EA.Repository, ByVal MenuName As String, ByVal ItemName As String) Notice that your code can directly access Enterprise Architect data and UI elements using Repository methods. Also look at EA_GetMenuItems.

EA_OnAttributeTagEdit ( EA Repository, long AttributeID, string &TagName, string &TagValue, string &TagNotes ) : void

EA_OnAttributeTagEdit is called when the user clicks the ellipsis ( ... ) button for a Tagged Value of type AddinBroadcast on an attribute. The Add-In displays fields to show and change the value and notes; this function provides the initial values for the Tagged Value notes and value, and takes on any changes on exit of the function.

EA_OnConnectorTagEdit ( EA Repository, long ConnectorID, string &TagName, string &TagValue, string &TagNotes ) : void

EA_OnConnectorTagEdit is called when the user clicks the ellipsis ( ... ) button for a Tagged Value of type AddinBroadcast on a connector.The Add-In displays fields to show and change the value and notes; this function provides the initial values for the Tagged Value notes and value, and takes on any changes on exit of the function

EA_OnContextItemChanged ( EA Repository, string GUID, EA ot ) : void

EA_OnContextItemChanged notifies Add-Ins that a different item is now in context. This event occurs after a user has selected an item anywhere in the Enterprise Architect GUI. Add-Ins that require knowledge of the current item in context can subscribe to this broadcast function. If ot = otRepository, then this function behaves the same as EA_FileOpen. Also look at EA_OnContextItemDoubleClicked and EA_OnNotifyContextItemModified.

EA_OnContextItemDoubleClicked ( EA Repository, string GUID, EA ot ) : bool

EA_OnContextItemDoubleClicked notifies Add-Ins that the user has double-clicked the item currently in context. This event occurs when a user has double-clicked (or pressed [Enter]) on the item in context, either in a diagram or in the Project Browser. Add-Ins to handle events can subscribe to this broadcast function. Also look at EA_OnContextItemChanged and EA_OnNotifyContextItemModified.

EA_OnElementTagEdit ( EA Repository, long ObjectID, string &TagName, string &TagValue, string &TagNotes ) : void

EA_OnElementTagEdit is called when the user clicks the ellipsis ( ... ) button for a Tagged Value of type AddinBroadcast on a element.The Add-In displays fields to show and change the value and notes; this function provides the initial values for the Tagged Value notes and value, and takes on any changes on exit of the function

EA_OnEndValidation ( EA Repository, object Args ) : void

EA_OnEndValidation notifies Add-Ins that model validation has completed. Use this event to arrange any clean-up operations arising from the validation.

EA_OnMethodTagEdit ( EA Repository, long MethodID, string &TagName, string &TagValue, string &TagNotes ) : void

EA_OnMethodTagEdit is called when the user clicks the ellipsis ( ... ) button for a Tagged Value of type AddinBroadcast on a method.The Add-In displays fields to show and change the value and notes; this function provides the initial values for the Tagged Value notes and value, and takes on any changes on exit of the function

EA_OnNotifyContextItemModified ( EA Repository, string GUID, EA ot ) : void

EA_OnNotifyContextItemModified notifies Add-Ins that the current context item has been modified. This event occurs when a user has modified the context item. Add-Ins that require knowledge of when an item has been modified can subscribe to this broadcast function. Also look at EA_OnContextItemChanged and EA_OnContextItemDoubleClicked.

EA_OnOutputItemClicked ( EA Repository, string TabName, string LineText, long ID ) : void

EA_OnOutputItemClicked events inform Add-Ins that the user has clicked on a list entry in the system tab or one of the user defined output tabs. Usually an Add-In responds to this event in order to capture activity on an output tab they had previously created through a call to Repository.AddTab(). Note that every loaded Add-In receives this event for every click on an output tab in Enterprise Architect - irrespective of whether the Add-In created that tab. Add-Ins should therefore check the TabName parameter supplied by this event to ensure that they are not responding to other Add-Ins' events. Also look at EA_OnOutputItemDoubleClicked.

EA_OnOutputItemDoubleClicked ( EA Repository, string TabName, string LineText, long ID ) : void

EA_OnOutputItemDoubleClicked events informs Add-Ins that the user has used the mouse to double-click on a list entry in one of the user-defined output tabs. Usually an Add-In responds to this event in order to capture activity on an output tab they had previously created through a call to Repository.AddTab(). Note that every loaded Add-In receives this event for every double-click on an output tab in Enterprise Architect - irrespective of whether the Add-In created that tab. Add-Ins should therefore check the TabName parameter supplied by this event to ensure that they are not responding to other Add-Ins' events. Also look at EA_OnOutputItemClicked.

EA_OnPostCloseDiagram ( EA Repository, int DiagramID ) : void

EA_OnPostCloseDiagram notifies Add-Ins that a diagram has been closed. Also look at EA_OnPostOpenDiagram.

EA_OnPostNewAttribute ( EA Repository, EA Info ) : bool

EA_OnPostNewAttribute notifies Add-Ins that a new attribute has been created on a diagram. It enables Add-Ins to modify the attribute upon creation. This event occurs when a user creates a new attribute on an element by either drag-dropping from the Project Browser, using the Attributes Properties dialog, or using the in-place editor on the diagram. The notification is provided immediately after the attribute is created. Set Repository.SuppressEADialogs to true to suppress Enterprise Architect from showing its default dialogs. Also look at EA_OnPreNewAttribute.

EA_OnPostNewConnector ( EA Repository, EA Info ) : bool

EA_OnPostNewConnector notifies Add-Ins that a new connector has been created on a diagram. It enables Add-Ins to modify the connector upon creation. This event occurs after a user has dragged a new connector from the Toolbox or Resources window onto a diagram. The notification is provided immediately after the connector is added to the model. Set Repository.SuppressEADialogs to true to suppress Enterprise Architect from showing its default dialogs. Also look at EA_OnPreNewConnector.

EA_OnPostNewDiagram ( EA Repository, EA Info ) : bool

EA_OnPostNewDiagram notifies Add-Ins that a new diagram has been created. It enables Add-Ins to modify the diagram upon creation. Set Repository.SuppressEADialogs to true to suppress Enterprise Architect from showing its default dialogs. Also look at EA_OnPreNewDiagram.

EA_OnPostNewDiagramObject ( EA Repository, EA Info ) : bool

EA_OnPostNewDiagramObject notifies Add-Ins that a new object has been created on a diagram. It enables Add-Ins to modify the object upon creation. This event occurs after a user has dragged a new object from the Project Browser or Resources window onto a diagram. The notification is provided immediately after the object is added to the diagram. Set Repository.SuppressEADialogs to true to suppress Enterprise Architect from showing its default dialogs. Also look at EA_OnPreNewDiagramObject.

EA_OnPostNewElement ( EA Repository, EA Info ) : bool

EA_OnPostNewElement notifies Add-Ins that a new element has been created on a diagram. It enables Add-Ins to modify the element upon creation. This event occurs after a user has dragged a new element from the Toolbox or Resources window onto a diagram. The notification is provided immediately after the element is added to the model. Set Repository.SuppressEADialogs to true to suppress Enterprise Architect from showing its default dialogs. Also look at EA_OnPreNewElement.

EA_OnPostNewGlossaryTerm ( EA Repository, EA Info ) : bool

EA_OnPostNewGlossaryTerm notifies Add-Ins that a new glossary term has been created. It enables Add-Ins to modify the glossary term upon creation. The notification is provided immediately after the glossary term is added to the model. Set Repository.SuppressEADialogs to true to suppress Enterprise Architect from showing its default dialogs. Also look at EA_OnPreNewGlossaryTerm.

EA_OnPostNewMethod ( EA Repository, EA Info ) : bool

EA_OnPostNewMethod notifies Add-Ins that a new method has been created on a diagram. It enables Add-Ins to modify the method upon creation. This event occurs when a user creates a new method on an element by either drag-dropping from the Project Browser, using the method's Properties dialog, or using the in-place editor on the diagram. The notification is provided immediately after the method is created. Set Repository.SuppressEADialogs to true to suppress Enterprise Architect from showing its default dialogs. Also look at EA_OnPreNewMethod.

EA_OnPostNewPackage ( EA Repository, EA Info ) : bool

EA_OnPostNewPackage notifies Add-Ins that a new package has been created on a diagram. It enables Add-Ins to modify the package upon creation. This event occurs when a user drags a new package from the Toolbox or Resources window onto a diagram, or by selecting the New Package icon from the Project Browser. Set Repository.SuppressEADialogs to true to suppress Enterprise Architect from showing its default dialogs. Also look at EA_OnPreNewPackage.

EA_OnPostOpenDiagram ( EA Repository, int DiagramID ) : void

EA_OnPostOpenDiagram notifies Add-Ins that a diagram has been opened. Also look at EA_OnPostCloseDiagram.

EA_OnPostTransform ( EA Repository, EA Info ) : bool

EA_OnPostTransform notifies Add-Ins that an MDG transformation has taken place with the output in the specified target package. This event occurs when a user runs an MDG transform on one or more target packages. The notification is provided for each transform/target package immediately after all transform processes have completed.

EA_OnPreDeleteAttribute ( EA Repository, EA Info ) : bool

EA_OnPreDeleteAttribute notifies Add-Ins that an attribute is to be deleted from the model. It enables Add-Ins to permit or deny deletion of the attribute. This event occurs when a user deletes an attribute from the Project Browser or on a diagram. The notification is provided immediately before the attribute is deleted, so that the Add-In can disable deletion of the attribute.

EA_OnPreDeleteConnector ( EA Repository, EA Info ) : bool

EA_OnPreDeleteConnector notifies Add-Ins that an connector is to be deleted from the model. It enables Add-Ins to permit or deny deletion of the connector. This event occurs when a user attempts to permanently delete a connector on a diagram. The notification is provided immediately before the connector is deleted, so that the Add-In can disable deletion of the connector.

EA_OnPreDeleteDiagram ( EA Repository, EA Info ) : bool

EA_OnPreDeleteDiagram notifies Add-Ins that an diagram is to be deleted from the model. It enables Add-Ins to permit or deny deletion of the diagram. This event occurs when a user attempts to permanently delete a diagram from the Project Browser. The notification is provided immediately before the diagram is deleted, so that the Add-In can disable deletion of the diagram.

EA_OnPreDeleteDiagramObject ( EA Repository, EA Info ) : bool

EA_OnPreDeleteDiagramObject notifies Add-Ins that a diagram object is to be deleted from the model. It enables Add-Ins to permit or deny deletion of the element. This event occurs when a user attempts to permanently delete an element from a diagram. The notification is provided immediately before the element is deleted, so that the Add-In can disable deletion of the element.

EA_OnPreDeleteElement ( EA Repository, EA Info ) : bool

EA_OnPreDeleteElement notifies Add-Ins that an element is to be deleted from the model. It enables Add-Ins to permit or deny deletion of the element. This event occurs when a user deletes an element from the Project Browser or on a diagram. The notification is provided immediately before the element is deleted, so that the Add-In can disable deletion of the element.

EA_OnPreDeleteGlossaryTerm ( EA Repository, EA Info ) : bool

EA_OnPreDeleteGlossaryTerm notifies Add-Ins that a glossary term is to be deleted from the model. It enables Add-Ins to permit or deny deletion of the glossary term. The notification is provided immediately before the glossary term is deleted, so that the Add-In can disable deletion of the glossary term.

EA_OnPreDeleteMethod ( EA Repository, EA Info ) : bool

EA_OnPreDeleteMethod notifies Add-Ins that an method is to be deleted from the model. It enables Add-Ins to permit or deny deletion of the method. This event occurs when a user deletes an method from the Project Browser or on a diagram. The notification is provided immediately before the method is deleted, so that the Add-In can disable deletion of the method.

EA_OnPreDeletePackage ( EA Repository, EA Info ) : bool

EA_OnPreDeletePackage notifies Add-Ins that an package is to be deleted from the model. It enables Add-Ins to permit or deny deletion of the package. This event occurs when a user attempts to permanently delete a package from the Project Browser. The notification is provided immediately before the package is deleted, so that the Add-In can disable deletion of the package.

EA_OnPreDropFromTree ( EA Repository, EA Info ) : bool

When a user drags any kind of element from the Project Browser onto a diagram, EA_OnPreDropFromTree notifies the Add-In that a new item is about to be dropped onto a diagram. The notification is provided immediately before the element is dropped, so that the Add-In can override the default action that would be taken for this drag.

EA_OnPreExitInstance ( EA Repository ) : void

EA_OnPreExitInstance is not currently used.

EA_OnPreNewAttribute ( EA Repository, EA Info ) : bool

EA_OnPreNewAttribute notifies Add-Ins that a new attribute is about to be created on an element. It enables Add-Ins to permit or deny creation of the new attribute. This event occurs when a user creates a new attribute on an element by either drag-dropping from the Project Browser, using the Attributes Properties dialog, or using the in-place editor on the diagram. The notification is provided immediately before the attribute is created, so that the Add-In can disable addition of the attribute. Also look at EA_OnPostNewAttribute.

EA_OnPreNewConnector ( EA Repository, EA Info ) : bool

EA_OnPreNewConnector notifies Add-Ins that a new connector is about to be created on a diagram. It enables Add-Ins to permit or deny creation of a new connector. This event occurs when a user drags a new connector from the Toolbox or Resources window, onto a diagram. The notification is provided immediately before the connector is created, so that the Add-In can disable addition of the connector. Also look at EA_OnPostNewConnector.

EA_OnPreNewDiagram ( EA Repository, EA Info ) : bool

EA_OnPreNewDiagram notifies Add-Ins that a new diagram is about to be created. It enables Add-Ins to permit or deny creation of the new diagram. The notification is provided immediately before the diagram is created, so that the Add-In can disable addition of the diagram. Also look at EA_OnPostNewDiagram.

EA_OnPreNewDiagramObject ( EA Repository, EA Info ) : bool

EA_OnPreNewDiagramObject notifies Add-Ins that a new diagram object is about to be dropped on a diagram. It enables Add-Ins to permit or deny creation of the new object. This event occurs when a user drags an object from the Enterprise Architect Project Browser or Resources window onto a diagram. The notification is provided immediately before the object is created, so that the Add-In can disable addition of the object. Also look at EA_OnPostNewDiagramObject.

EA_OnPreNewElement ( EA Repository, EA Info ) : bool

EA_OnPreNewElement notifies Add-Ins that a new element is about to be created on a diagram. It enables Add-Ins to permit or deny creation of the new element. This event occurs when a user drags a new element from the Toolbox or Resources window onto a diagram. The notification is provided immediately before the element is created, so that the Add-In can disable addition of the element. Also look at EA_OnPostNewElement.

EA_OnPreNewGlossaryTerm ( EA Repository, EA Info ) : bool

EA_OnPreNewGlossaryTerm notifies Add-Ins that a new glossary term is about to be created. It enables Add-Ins to permit or deny creation of the new glossary term. The notification is provided immediately before the glossary term is created, so that the Add-In can disable addition of the element. Also look at EA_OnPostNewGlossaryTerm.

EA_OnPreNewMethod ( EA Repository, EA Info ) : bool

EA_OnPreNewMethod notifies Add-Ins that a new method is about to be created on an element. It enables Add-Ins to permit or deny creation of the new method. This event occurs when a user creates a new method on an element by either drag-dropping from the Project Browser, using the method Properties dialog, or using the in-place editor on the diagram. The notification is provided immediately before the method is created, so that the Add-In can disable addition of the method. Also look at EA_OnPostNewMethod.

EA_OnPreNewPackage ( EA Repository, EA Info ) : bool

EA_OnPreNewPackage notifies Add-Ins that a new package is about to be created in the model. It enables Add-Ins to permit or deny creation of the new package. This event occurs when a user drags a new package from the Toolbox or Resources window onto a diagram, or by selecting the New Package icon from the Project Browser. The notification is provided immediately before the package is created, so that the Add-In can disable addition of the package. Also look at EA_OnPostNewPackage.

EA_OnRetrieveModelTemplate ( EA Repository, string sLocation ) : string

EA_OnRetrieveModelTemplate requests that an Add-In pass a model template to Enterprise Architect. This event occurs when a user executes the Add a New Model Using Wizard command to add a model that has been defined by an MDG Technology. See the Incorporate Model Templates topic for details of how to define such model templates.

EA_OnRunAttributeRule ( EA Repository, string RuleID, string AttributeGUID, long ObjectID ) : void

This event is triggered once for each rule defined in EA_OnInitializeUserRules to be performed on each attribute in the selection being validated. If you don't want to perform the rule defined by RuleID on the given attribute, then simply return without performing any action. On performing any validation, if a validation error is found, use the Repository.ProjectInterface.PublishResult method to notify Enterprise Architect.

EA_OnRunConnectorRule ( EA Repository, string RuleID, long ConnectorID ) : void

This event is triggered once for each rule defined in EA_OnInitializeUserRules to be performed on each connector in the selection being validated. If you don't want to perform the rule defined by RuleID on the given connector, then simply return without performing any action. On performing any validation, if a validation error is found, use the Repository.ProjectInterface.PublishResult method to notify Enterprise Architect.

EA_OnRunDiagramRule ( EA Repository, string RuleID, long DiagramID ) : void

This event is triggered once for each rule defined in EA_OnInitializeUserRules to be performed on each diagram in the selection being validated. If you don't want to perform the rule defined by RuleID on the given diagram, then simply return without performing any action. On performing any validation, if a validation error is found, use the Repository.ProjectInterface.PublishResult method to notify Enterprise Architect.

EA_OnRunElementRule ( EA Repository, string RuleID, EA Element ) : void

This event is triggered once for each rule defined in EA_OnInitializeUserRules to be performed on each element in the selection being validated. If you don't want to perform the rule defined by RuleID on the given element, then simply return without performing any action. On performing any validation, if a validation error is found, use the Repository.ProjectInterface.PublishResult method to notify Enterprise Architect. Also look at EA_OnInitializeUserRules.

EA_OnRunMethodRule ( EA Repository, string RuleID, string MethodGUID, long ObjectID ) : void

This event is triggered once for each rule defined in EA_OnInitializeUserRules to be performed on each method in the selection being validated. If you don't want to perform the rule defined by RuleID on the given method, then simply return without performing any action. On performing any validation, if a validation error is found, use the Repository.ProjectInterface.PublishResult method to notify Enterprise Architect.

EA_OnRunPackageRule ( EA Repository, string RuleID, long PackageID ) : void

This event is triggered once for each rule defined in EA_OnInitializeUserRules to be performed on each package in the selection being validated. If you don't want to perform the rule defined by RuleID on the given package, then simply return without performing any action. On performing any validation, if a validation error is found, use the Repository.ProjectInterface.PublishResult method to notify Enterprise Architect.

EA_OnRunParameterRule ( EA Repository, string RuleID, string ParameterGUID, string MethodGUID, long ObjectID ) : void

This event is triggered once for each rule defined in EA_OnInitializeUserRules to be performed on each parameter in the selection being validated. If you don't want to perform the rule defined by RuleID on the given parameter, then simply return without performing any action. On performing any validation, if a validation error is found, use the Repository.ProjectInterface.PublishResult parameter to notify Enterprise Architect.

EA_OnStartValidation ( EA Repository, object Args ) : void

EA_OnStartValidation notifies Add-Ins that a user has invoked the model validation command from Enterprise Architect.

EA_OnTabChanged ( EA Repository, string TabName, int DiagramID ) : void

EA_OnTabChanged notifies Add-Ins that the currently open tab has changed. Diagrams do not generate the message when they are first opened - use the broadcast event EA_OnPostOpenDiagram for this purpose.

EA_QueryAvailableCompartments ( EA Repository ) : object

This event occurs when Enterprise Architect's diagrams are refreshed. It is a request for the Add-In to provide a list of user-defined compartments. The EA_GetCompartmentData event then queries each object for the data to display in each user-defined compartment.

EA_ShowHelp ( EA Repository, string MenuLocation, string MenuName, string ItemName ) : void

The EA_ShowHelp event enables the Add-In to show a help topic for a particular menu option. When the user has an Add-In menu option selected, pressing [F1] can be delegated to the required Help topic by the Add-In and a suitable help message shown. This event is raised when the user presses [F1] on a menu option that is not a parent menu. Also look at EA_GetMenuItems.

MDG_BuildProject ( EA Repository, string PackageGuid ) : void

MDG_BuildProject enables the Add-In to handle file changes caused by generation. This function is called in response to a user selecting the Add-Ins | Build Project menu option. Respond to this event by compiling the project source files into a running application. Also look at MDG_RunExe.

MDG_Connect ( EA Repository, long PackageID, string PackageGuid ) : long

MDG_Connect enables the Add-In to handle user driven request to connect a model branch to an external application. This function is called when the user attempts to connect a particular Enterprise Architect package to an as yet unspecified external project. This event enables the Add-In to interact with the user to specify such a project. The Add-In is responsible for retaining the connection details, which should be stored on a per-user or per-workstation basis. That is, users who share a common Enterprise Architect model over a network should be able to connect and disconnect to external projects independently of one another. The Add-In should therefore not store connection details in an Enterprise Architect repository. A suitable place to store such details would be: SHGetFolderPath(..CSIDL_APPDATA..)\AddinName. The PackageGuid parameter is the same identifier as required for most events relating to the MDG Add-In. Therefore it is recommended that the connection details be indexed using the PackageGuid value. The PackageID parameter is provided to aid fast retrieval of package details from Enterprise Architect, should this be required. Also look at MDG_Disconnect.

MDG_Disconnect ( EA Repository, string PackageGuid ) : long

MDG_Disconnect enables the Add-In to respond to user requests to disconnect the model branch from an external project. This function is called when the user attempts to disconnect an associated external project. The Add-In is required to delete the details of the connection. Also look at MDG_Connect.

MDG_GetConnectedPackages ( EA Repository ) : object

MDG_GetConnectedPackages enables the Add-In to return a list of current connection between Enterprise Architect and an external application. This function is called when the Add-In is first loaded, and is expected to return a list of the available connections to external projects for this Add-In. Also look at MDG_Connect

MDG_GetProperty ( EA Repository, string PackageGuid, string PropertyName ) : object

MDG_GetProperty provides miscellaneous Add-In details to Enterprise Architect. This function is called by Enterprise Architect to poll the Add-In for information relating to the PropertyName. This event should occur in as short a duration as possible as Enterprise Architect does not cache the information provided by the function. Values corresponding to the following PropertyNames must be provided: - IconID - Return the name of a DLL and a resource identifier in the format #ResID, where the resource ID indicates an Icon; for example, c:\program files\myapp\myapp.dlll#101 - Language - Return the default language that Classes should be assigned when they are created in Enterprise Architect - HiddenMenus - Return one or more values from the MDGMenus enumeration to hide menus that do not apply to your Add-In. For example: if( PropertyName == "HiddenMenus" ) return mgBuildProject + mgRun;

MDG_Merge ( EA Repository, string PackageGuid, object &SynchObjects, string &SynchType, object &ExportObjects, object &ExportFiles, object &ImportFiles, string &IgnoreLocked, string &Language ) : long

MDG_Merge enables the Add-In to jointly handle changes to both the model branch and the code project that the model branch is connected to. This event should be called whenever the user has asked to merge their model branch with its connected code project, or whenever the user has established a new connection to a code project. The purpose of this event is to enable the Add-In to interact with the user to perform a merge between the model branch and the connected project. Also look at MDG_Connect, MDG_PreMerge and MDG_PostMerge. Merge A merge consists of three major operations: - Export: Where newly created model objects are exported into code and made available to the code project. - Import: Where newly created code objects, Classes and such things are imported into the model. - Synchronize: Where objects available both to the model and in code are jointly updated to reflect changes made in either the model, code project or both. - Synchronize Type The Synchronize operation can take place in one of four different ways. Each of these ways corresponds to a value returned by SynchType: - None: (SynchType = 0) No synchronization is to be performed - Forward: (SynchType = 1) Forward synchronization, between the model branch and the code project is to occur - Reverse: (SynchType = 2) Reverse synchronization, between the code project and the model branch is to occur - Both: (SynchType = 3) Reverse, then Forward synchronization's are to occur. Object ID Format Each of the Object IDs listed in the string arrays described above should be composed in the following format: (@namespace)*(#class)*($attribute|%operation|:property)*

MDG_NewClass ( EA Repository, string PackageGuid, string CodeID, string &Language ) : string

MDG_NewClass enables the Add-In to alter details of a Class before it is created. This method is called when Enterprise Architect generates a new Class, and requires information relating to assigning the language and file path. The file path should be passed back as a return value and the language should be passed back via the language parameter. Also look at MDG_PreGenerate

MDG_PostGenerate ( EA Repository, string PackageGuid, string FilePath, string FileContents ) : long

MDG_PostGenerate enables the Add-In to handle file changes caused by generation. This event is called after Enterprise Architect has prepared text to replace the existing contents of a file. Responding to this event enables the Add-In to write to the linked application's user interface rather than modify the file directly. When the contents of a file are changed, Enterprise Architect passes FileContents as a non-empty string. New files created as a result of code generation are also sent through this mechanism, enabling Add-Ins to add new files to the linked project's file list. When new files are created Enterprise Architect passes FileContents as an empty string. When a non-zero is returned by this function, the Add-In has successfully written the contents of the file. A zero value for the return indicates to Enterprise Architect that the file must be saved. Also look at MDG_PreGenerate.

MDG_PostMerge ( EA Repository, string PackageGuid ) : long

MDG_PostMerge is called after a merge process has been completed. This function is called by Enterprise Architect after the merge process has been completed. Note: File save checking should not be performed with this function, but should be handled by MDG_PreGenerate, MDG_PostGenerate and MDG_PreReverse. Also look at MDG_PreMerge and MDG_Merge.

MDG_PreGenerate ( EA Repository, string PackageGuid ) : long

MDG_PreGenerate enables the Add-In to deal with unsaved changes. This function is called immediately before Enterprise Architect attempts to generate files from the model. A possible use of this function would be to prompt the user to save unsaved source files. Also look at MDG_PostGenerate.

MDG_PreMerge ( EA Repository, string PackageGuid ) : long

MDG_PreMerge is called after a merge process has been initiated by the user and before Enterprise Architect performs the merge process. This event is called after a user has performed their interactions with the merge screen and has confirmed the merge with the OK button, but before Enterprise Architect performs the merge process using the data provided by the MDG_Merge call, before any changes have been made to the model or the connected project. This event is made available to provide the Add-In with the opportunity to generally set internal Add-In flags to augment the MDG_PreGenerate, MDG_PostGenerate and MDG_PreReverse events. Note: File save checking should not be performed with this function, but should be handled by MDG_PreGenerate, MDG_PostGenerate and MDG_PreReverse. Also look at MDG_Merge and MDG_PostMerge.

MDG_PreReverse ( EA Repository, string PackageGuid, object FilePaths ) : void

MDG_PreReverse enables the Add-In to save file changes before being imported into Enterprise Architect. This function operates on a list of files that are about to be reverse-engineered into Enterprise Architect. If the user is working on unsaved versions of these files in an editor, you could either prompt the user or save automatically. Also look at MDG_PostGenerate and MDG_PreGenerate.

MDG_RunExe ( EA Repository, string PackageGuid ) : void

MDG_RunExe enables the Add-In to run the target application. This function is called when the user selects the Add-Ins | Run Exe menu option. Respond to this event by launching the compiled application. Also look at MDG_BuildProject.

MDG_View ( EA Repository, string PackageGuid, string CodeID ) : long

MDG_View enables the Add-In to display user specified code elements. This function is called by Enterprise Architect when the user asks to view a particular code element. This enables the Add-In to present that element in its own way, usually in a code editor.

addNewScriptFunction ( MethodInfo operation, Script script ) : ScriptFunction

adds a script function for the given methodinfo to the given script

Private Methods

Method Description
callFunctions ( string functionName, object parameters, bool defaultValue ) : bool

executes the scriptfunctions with the given functionName and returns the boolean result of the function

callFunctions ( string functionName, object parameters, long defaultValue ) : long

executes the scriptfunctions with the given functionName and returns the long result of the function

callFunctions ( string functionName, object parameters ) : object

executes the scriptfunctions with the given functionName and returns wathever object is being returned by the scriptfunction

callFunctions ( string functionName, object parameters, string defaultValue ) : string

executes the scriptfunctions with the given functionName and returns the string result of the function

resetScripts ( ) : void

every 5 minutes we reset the scripts to make sure we are working with the lastest version

showSettings ( ) : void

show the settings dialog

Method Details

EAScriptAddinAddinClass() public method

constructor
public EAScriptAddinAddinClass ( ) : System
return System

EA_Disconnect() public method

The EA_Disconnect event enables the Add-In to respond to user requests to disconnect the model branch from an external project. This function is called when the Enterprise Architect closes. If you have stored references to Enterprise Architect objects (not particularly recommended anyway), you must release them here. In addition, .NET users must call memory management functions as shown below: GC.Collect(); GC.WaitForPendingFinalizers(); Also look at EA_Connect.
public EA_Disconnect ( ) : void
return void

EA_FileClose() public method

The EA_FileClose event enables the Add-In to respond to a File Close event. When Enterprise Architect closes an opened Model file, this event is raised and passed to all Add-Ins implementing this method. This event occurs when the model currently opened within Enterprise Architect is about to be closed (when another model is about to be opened or when Enterprise Architect is about to shutdown). Also look at EA_FileOpen and EA_FileNew.
public EA_FileClose ( EA Repository ) : void
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
return void

EA_FileNew() public method

The EA_FileNew event enables the Add-In to respond to a File New event. When Enterprise Architect creates a new model file, this event is raised and passed to all Add-Ins implementing this method. The event occurs when the model being viewed by the Enterprise Architect user changes, for whatever reason (through user interaction or Add-In activity). Also look at EA_FileClose and EA_FileOpen.
public EA_FileNew ( EA Repository ) : void
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
return void

EA_FileOpen() public method

The EA_FileOpen event enables the Add-In to respond to a File Open event. When Enterprise Architect opens a new model file, this event is raised and passed to all Add-Ins implementing this method. The event occurs when the model being viewed by the Enterprise Architect user changes, for whatever reason (through user interaction or Add-In activity). Also look at EA_FileClose and EA_FileNew.
public EA_FileOpen ( EA Repository ) : void
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
return void

EA_GetCompartmentData() public method

This event occurs when Enterprise Architect is instructed to redraw an element. It requests that the Add-In provide the data to populate the element's compartment.
public EA_GetCompartmentData ( EA Repository, string sCompartment, string sGUID, EA oType ) : object
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
sCompartment string The name of the compartment for which data is being requested.
sGUID string The GUID of the element for which data is being requested.
oType EA The type of the element for which data is being requested.
return object

EA_GetMenuItems() public method

The EA_GetMenuItems event enables the Add-In to provide the Enterprise Architect user interface with additional Add-In menu options in various context and main menus. When a user selects an Add-In menu option, an event is raised and passed back to the Add-In that originally defined that menu option. This event is raised just before Enterprise Architect has to show particular menu options to the user, and its use is described in the Define Menu Items topic. Also look at: - EA_MenuClick - EA_GetMenuState.
public EA_GetMenuItems ( EA Repository, string MenuLocation, string MenuName ) : object
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
MenuLocation string String representing the part of the user interface that brought up the menu. /// Can be TreeView, MainMenu or Diagram.
MenuName string The name of the parent menu for which sub-items are to be defined. In the case of the top-level menu it is an empty string.
return object

EA_GetMenuState() public method

The EA_GetMenuState event enables the Add-In to set a particular menu option to either enabled or disabled. This is useful when dealing with locked packages and other situations where it is convenient to show a menu option, but not enable it for use. This event is raised just before Enterprise Architect has to show particular menu options to the user. Its use is described in the Define Menu Items topic. Also look at EA_GetMenuItems.
public EA_GetMenuState ( EA Repository, string MenuLocation, string MenuName, string ItemName, bool &IsEnabled, bool &IsChecked ) : void
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
MenuLocation string String representing the part of the user interface that brought up the menu. /// Can be TreeView, MainMenu or Diagram.
MenuName string The name of the parent menu for which sub-items must be defined. In the case of the top-level menu it is an empty string.
ItemName string The name of the option actually clicked, for example, Create a New Invoice.
IsEnabled bool Boolean. Set to False to disable this particular menu option.
IsChecked bool Boolean. Set to True to check this particular menu option.
return void

EA_MenuClick() public method

EA_MenuClick events are received by an Add-In in response to user selection of a menu option. The event is raised when the user clicks on a particular menu option. When a user clicks on one of your non-parent menu options, your Add-In receives a MenuClick event, defined as follows: Sub EA_MenuClick(Repository As EA.Repository, ByVal MenuName As String, ByVal ItemName As String) Notice that your code can directly access Enterprise Architect data and UI elements using Repository methods. Also look at EA_GetMenuItems.
public EA_MenuClick ( EA Repository, string MenuLocation, string MenuName, string ItemName ) : void
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
MenuLocation string String representing the part of the user interface that brought up the menu. /// Can be TreeView, MainMenu or Diagram.
MenuName string The name of the parent menu for which sub-items must be defined. In the case of the top-level menu it is an empty string.
ItemName string The name of the option actually clicked, for example, Create a New Invoice.
return void

EA_OnAttributeTagEdit() public method

EA_OnAttributeTagEdit is called when the user clicks the ellipsis ( ... ) button for a Tagged Value of type AddinBroadcast on an attribute. The Add-In displays fields to show and change the value and notes; this function provides the initial values for the Tagged Value notes and value, and takes on any changes on exit of the function.
public EA_OnAttributeTagEdit ( EA Repository, long AttributeID, string &TagName, string &TagValue, string &TagNotes ) : void
Repository EA An EA.Repository object representing the currently open /// Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
AttributeID long The ID of the attribute that this Tagged Value is on
TagName string The name of the Tagged Value to edit.
TagValue string The current value of the tag; if the value is updated, /// the new value is stored in the repository on exit of the function.
TagNotes string The current value of the Tagged Value notes; if the value /// is updated, the new value is stored in the repository on exit of the function.
return void

EA_OnConnectorTagEdit() public method

EA_OnConnectorTagEdit is called when the user clicks the ellipsis ( ... ) button for a Tagged Value of type AddinBroadcast on a connector.The Add-In displays fields to show and change the value and notes; this function provides the initial values for the Tagged Value notes and value, and takes on any changes on exit of the function
public EA_OnConnectorTagEdit ( EA Repository, long ConnectorID, string &TagName, string &TagValue, string &TagNotes ) : void
Repository EA An EA.Repository object representing the currently open /// Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
ConnectorID long The ID of the connector that this Tagged Value is on.
TagName string The name of the Tagged Value to edit.
TagValue string The current value of the tag; if the value is updated, /// the new value is stored in the repository on exit of the function.
TagNotes string
return void

EA_OnContextItemChanged() public method

EA_OnContextItemChanged notifies Add-Ins that a different item is now in context. This event occurs after a user has selected an item anywhere in the Enterprise Architect GUI. Add-Ins that require knowledge of the current item in context can subscribe to this broadcast function. If ot = otRepository, then this function behaves the same as EA_FileOpen. Also look at EA_OnContextItemDoubleClicked and EA_OnNotifyContextItemModified.
public EA_OnContextItemChanged ( EA Repository, string GUID, EA ot ) : void
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
GUID string Contains the GUID of the new context item. /// This value corresponds to the following properties, depending on the value of the ot parameter: /// ot (ObjectType) - GUID value /// otElement - Element.ElementGUID /// otPackage - Package.PackageGUID /// otDiagram - Diagram.DiagramGUID /// otAttribute - Attribute.AttributeGUID /// otMethod - Method.MethodGUID /// otConnector - Connector.ConnectorGUID /// otRepository - NOT APPLICABLE, GUID is an empty string ///
ot EA Specifies the type of the new context item.
return void

EA_OnContextItemDoubleClicked() public method

EA_OnContextItemDoubleClicked notifies Add-Ins that the user has double-clicked the item currently in context. This event occurs when a user has double-clicked (or pressed [Enter]) on the item in context, either in a diagram or in the Project Browser. Add-Ins to handle events can subscribe to this broadcast function. Also look at EA_OnContextItemChanged and EA_OnNotifyContextItemModified.
public EA_OnContextItemDoubleClicked ( EA Repository, string GUID, EA ot ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
GUID string Contains the GUID of the new context item. /// This value corresponds to the following properties, depending on the value of the ot parameter: /// ot (ObjectType) - GUID value /// otElement - Element.ElementGUID /// otPackage - Package.PackageGUID /// otDiagram - Diagram.DiagramGUID /// otAttribute - Attribute.AttributeGUID /// otMethod - Method.MethodGUID /// otConnector - Connector.ConnectorGUID ///
ot EA Specifies the type of the new context item.
return bool

EA_OnElementTagEdit() public method

EA_OnElementTagEdit is called when the user clicks the ellipsis ( ... ) button for a Tagged Value of type AddinBroadcast on a element.The Add-In displays fields to show and change the value and notes; this function provides the initial values for the Tagged Value notes and value, and takes on any changes on exit of the function
public EA_OnElementTagEdit ( EA Repository, long ObjectID, string &TagName, string &TagValue, string &TagNotes ) : void
Repository EA An EA.Repository object representing the currently open /// Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
ObjectID long The ID of the object (element) that this Tagged Value is on.
TagName string The name of the Tagged Value to edit.
TagValue string The current value of the tag; if the value is updated, /// the new value is stored in the repository on exit of the function.
TagNotes string
return void

EA_OnEndValidation() public method

EA_OnEndValidation notifies Add-Ins that model validation has completed. Use this event to arrange any clean-up operations arising from the validation.
public EA_OnEndValidation ( EA Repository, object Args ) : void
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Args object Contains a (Variant) list of Rule Categories that were active for the invocation of model validation that has just completed.
return void

EA_OnMethodTagEdit() public method

EA_OnMethodTagEdit is called when the user clicks the ellipsis ( ... ) button for a Tagged Value of type AddinBroadcast on a method.The Add-In displays fields to show and change the value and notes; this function provides the initial values for the Tagged Value notes and value, and takes on any changes on exit of the function
public EA_OnMethodTagEdit ( EA Repository, long MethodID, string &TagName, string &TagValue, string &TagNotes ) : void
Repository EA An EA.Repository object representing the currently open /// Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
MethodID long The ID of the method that this Tagged Value is on.
TagName string The name of the Tagged Value to edit.
TagValue string The current value of the tag; if the value is updated, /// the new value is stored in the repository on exit of the function.
TagNotes string
return void

EA_OnNotifyContextItemModified() public method

EA_OnNotifyContextItemModified notifies Add-Ins that the current context item has been modified. This event occurs when a user has modified the context item. Add-Ins that require knowledge of when an item has been modified can subscribe to this broadcast function. Also look at EA_OnContextItemChanged and EA_OnContextItemDoubleClicked.
public EA_OnNotifyContextItemModified ( EA Repository, string GUID, EA ot ) : void
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
GUID string Contains the GUID of the new context item. /// This value corresponds to the following properties, depending on the value of the ot parameter: /// ot (ObjectType) - GUID value /// otElement - Element.ElementGUID /// otPackage - Package.PackageGUID /// otDiagram - Diagram.DiagramGUID /// otAttribute - Attribute.AttributeGUID /// otMethod - Method.MethodGUID /// otConnector - Connector.ConnectorGUID ///
ot EA Specifies the type of the new context item.
return void

EA_OnOutputItemClicked() public method

EA_OnOutputItemClicked events inform Add-Ins that the user has clicked on a list entry in the system tab or one of the user defined output tabs. Usually an Add-In responds to this event in order to capture activity on an output tab they had previously created through a call to Repository.AddTab(). Note that every loaded Add-In receives this event for every click on an output tab in Enterprise Architect - irrespective of whether the Add-In created that tab. Add-Ins should therefore check the TabName parameter supplied by this event to ensure that they are not responding to other Add-Ins' events. Also look at EA_OnOutputItemDoubleClicked.
public EA_OnOutputItemClicked ( EA Repository, string TabName, string LineText, long ID ) : void
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
TabName string The name of the tab that the click occurred in. /// Usually this would have been created through Repository.AddTab().
LineText string The text that had been supplied as the String parameter in the original call to Repository.WriteOutput().
ID long The ID value specified in the original call to Repository.WriteOutput().
return void

EA_OnOutputItemDoubleClicked() public method

EA_OnOutputItemDoubleClicked events informs Add-Ins that the user has used the mouse to double-click on a list entry in one of the user-defined output tabs. Usually an Add-In responds to this event in order to capture activity on an output tab they had previously created through a call to Repository.AddTab(). Note that every loaded Add-In receives this event for every double-click on an output tab in Enterprise Architect - irrespective of whether the Add-In created that tab. Add-Ins should therefore check the TabName parameter supplied by this event to ensure that they are not responding to other Add-Ins' events. Also look at EA_OnOutputItemClicked.
public EA_OnOutputItemDoubleClicked ( EA Repository, string TabName, string LineText, long ID ) : void
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
TabName string The name of the tab that the click occurred in. /// Usually this would have been created through Repository.AddTab().
LineText string The text that had been supplied as the String parameter in the original call to Repository.WriteOutput().
ID long The ID value specified in the original call to Repository.WriteOutput().
return void

EA_OnPostCloseDiagram() public method

EA_OnPostCloseDiagram notifies Add-Ins that a diagram has been closed. Also look at EA_OnPostOpenDiagram.
public EA_OnPostCloseDiagram ( EA Repository, int DiagramID ) : void
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
DiagramID int Contains the Diagram ID of the diagram that was closed.
return void

EA_OnPostNewAttribute() public method

EA_OnPostNewAttribute notifies Add-Ins that a new attribute has been created on a diagram. It enables Add-Ins to modify the attribute upon creation. This event occurs when a user creates a new attribute on an element by either drag-dropping from the Project Browser, using the Attributes Properties dialog, or using the in-place editor on the diagram. The notification is provided immediately after the attribute is created. Set Repository.SuppressEADialogs to true to suppress Enterprise Architect from showing its default dialogs. Also look at EA_OnPreNewAttribute.
public EA_OnPostNewAttribute ( EA Repository, EA Info ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Info EA Contains the following EventProperty object for the new attribute: /// - AttributeID: A long value corresponding to Attribute.AttributeID.
return bool

EA_OnPostNewConnector() public method

EA_OnPostNewConnector notifies Add-Ins that a new connector has been created on a diagram. It enables Add-Ins to modify the connector upon creation. This event occurs after a user has dragged a new connector from the Toolbox or Resources window onto a diagram. The notification is provided immediately after the connector is added to the model. Set Repository.SuppressEADialogs to true to suppress Enterprise Architect from showing its default dialogs. Also look at EA_OnPreNewConnector.
public EA_OnPostNewConnector ( EA Repository, EA Info ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Info EA Contains the following EventProperty object for the new connector: /// - ConnectorID: A long value corresponding to Connector.ConnectorID. ///
return bool

EA_OnPostNewDiagram() public method

EA_OnPostNewDiagram notifies Add-Ins that a new diagram has been created. It enables Add-Ins to modify the diagram upon creation. Set Repository.SuppressEADialogs to true to suppress Enterprise Architect from showing its default dialogs. Also look at EA_OnPreNewDiagram.
public EA_OnPostNewDiagram ( EA Repository, EA Info ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Info EA Contains the following EventProperty object for the new diagram: /// - DiagramID: A long value corresponding to Diagram.DiagramID.
return bool

EA_OnPostNewDiagramObject() public method

EA_OnPostNewDiagramObject notifies Add-Ins that a new object has been created on a diagram. It enables Add-Ins to modify the object upon creation. This event occurs after a user has dragged a new object from the Project Browser or Resources window onto a diagram. The notification is provided immediately after the object is added to the diagram. Set Repository.SuppressEADialogs to true to suppress Enterprise Architect from showing its default dialogs. Also look at EA_OnPreNewDiagramObject.
public EA_OnPostNewDiagramObject ( EA Repository, EA Info ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Info EA Contains the following EventProperty object for the new element: /// - ObjectID: A long value corresponding to Object.ObjectID.
return bool

EA_OnPostNewElement() public method

EA_OnPostNewElement notifies Add-Ins that a new element has been created on a diagram. It enables Add-Ins to modify the element upon creation. This event occurs after a user has dragged a new element from the Toolbox or Resources window onto a diagram. The notification is provided immediately after the element is added to the model. Set Repository.SuppressEADialogs to true to suppress Enterprise Architect from showing its default dialogs. Also look at EA_OnPreNewElement.
public EA_OnPostNewElement ( EA Repository, EA Info ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Info EA Contains the following EventProperty object for the new element: /// - ElementID: A long value corresponding to Element.ElementID.
return bool

EA_OnPostNewGlossaryTerm() public method

EA_OnPostNewGlossaryTerm notifies Add-Ins that a new glossary term has been created. It enables Add-Ins to modify the glossary term upon creation. The notification is provided immediately after the glossary term is added to the model. Set Repository.SuppressEADialogs to true to suppress Enterprise Architect from showing its default dialogs. Also look at EA_OnPreNewGlossaryTerm.
public EA_OnPostNewGlossaryTerm ( EA Repository, EA Info ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Info EA Contains the following EventProperty objects for the glossary term to be deleted: /// TermID: A long value corresponding to Term.TermID.
return bool

EA_OnPostNewMethod() public method

EA_OnPostNewMethod notifies Add-Ins that a new method has been created on a diagram. It enables Add-Ins to modify the method upon creation. This event occurs when a user creates a new method on an element by either drag-dropping from the Project Browser, using the method's Properties dialog, or using the in-place editor on the diagram. The notification is provided immediately after the method is created. Set Repository.SuppressEADialogs to true to suppress Enterprise Architect from showing its default dialogs. Also look at EA_OnPreNewMethod.
public EA_OnPostNewMethod ( EA Repository, EA Info ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Info EA Contains the following EventProperty object for the new method: /// - MethodID: A long value corresponding to Method.MethodID.
return bool

EA_OnPostNewPackage() public method

EA_OnPostNewPackage notifies Add-Ins that a new package has been created on a diagram. It enables Add-Ins to modify the package upon creation. This event occurs when a user drags a new package from the Toolbox or Resources window onto a diagram, or by selecting the New Package icon from the Project Browser. Set Repository.SuppressEADialogs to true to suppress Enterprise Architect from showing its default dialogs. Also look at EA_OnPreNewPackage.
public EA_OnPostNewPackage ( EA Repository, EA Info ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Info EA Contains the following EventProperty object for the new package: /// - PackageID: A long value corresponding to Package.PackageID.
return bool

EA_OnPostOpenDiagram() public method

EA_OnPostOpenDiagram notifies Add-Ins that a diagram has been opened. Also look at EA_OnPostCloseDiagram.
public EA_OnPostOpenDiagram ( EA Repository, int DiagramID ) : void
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
DiagramID int Contains the Diagram ID of the diagram that was opened.
return void

EA_OnPostTransform() public method

EA_OnPostTransform notifies Add-Ins that an MDG transformation has taken place with the output in the specified target package. This event occurs when a user runs an MDG transform on one or more target packages. The notification is provided for each transform/target package immediately after all transform processes have completed.
public EA_OnPostTransform ( EA Repository, EA Info ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Info EA Contains the following EventProperty objects for the transform performed: /// - Transform: A string value corresponding to the name of the transform used /// - PackageID: A long value corresponding to Package.PackageID of the destination package.
return bool

EA_OnPreDeleteAttribute() public method

EA_OnPreDeleteAttribute notifies Add-Ins that an attribute is to be deleted from the model. It enables Add-Ins to permit or deny deletion of the attribute. This event occurs when a user deletes an attribute from the Project Browser or on a diagram. The notification is provided immediately before the attribute is deleted, so that the Add-In can disable deletion of the attribute.
public EA_OnPreDeleteAttribute ( EA Repository, EA Info ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Info EA Contains the following EventProperty object for the Attribute to be deleted: /// - AttributeID: A long value corresponding to Attribute.AttributeID.
return bool

EA_OnPreDeleteConnector() public method

EA_OnPreDeleteConnector notifies Add-Ins that an connector is to be deleted from the model. It enables Add-Ins to permit or deny deletion of the connector. This event occurs when a user attempts to permanently delete a connector on a diagram. The notification is provided immediately before the connector is deleted, so that the Add-In can disable deletion of the connector.
public EA_OnPreDeleteConnector ( EA Repository, EA Info ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Info EA Contains the following EventProperty object for the connector to be deleted: /// - ConnectorID: A long value corresponding to Connector.ConnectorID.
return bool

EA_OnPreDeleteDiagram() public method

EA_OnPreDeleteDiagram notifies Add-Ins that an diagram is to be deleted from the model. It enables Add-Ins to permit or deny deletion of the diagram. This event occurs when a user attempts to permanently delete a diagram from the Project Browser. The notification is provided immediately before the diagram is deleted, so that the Add-In can disable deletion of the diagram.
public EA_OnPreDeleteDiagram ( EA Repository, EA Info ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Info EA Contains the following EventProperty object for the diagram to be deleted: /// - DiagramID: A long value corresponding to Diagram.DiagramID.
return bool

EA_OnPreDeleteDiagramObject() public method

EA_OnPreDeleteDiagramObject notifies Add-Ins that a diagram object is to be deleted from the model. It enables Add-Ins to permit or deny deletion of the element. This event occurs when a user attempts to permanently delete an element from a diagram. The notification is provided immediately before the element is deleted, so that the Add-In can disable deletion of the element.
public EA_OnPreDeleteDiagramObject ( EA Repository, EA Info ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Info EA Contains the following EventProperty objects for the element to be deleted: /// · ID: A long value corresponding to DiagramObject.ElementID
return bool

EA_OnPreDeleteElement() public method

EA_OnPreDeleteElement notifies Add-Ins that an element is to be deleted from the model. It enables Add-Ins to permit or deny deletion of the element. This event occurs when a user deletes an element from the Project Browser or on a diagram. The notification is provided immediately before the element is deleted, so that the Add-In can disable deletion of the element.
public EA_OnPreDeleteElement ( EA Repository, EA Info ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Info EA Contains the following EventProperty object for the element to be deleted: /// - ElementID: A long value corresponding to Element.ElementID.
return bool

EA_OnPreDeleteGlossaryTerm() public method

EA_OnPreDeleteGlossaryTerm notifies Add-Ins that a glossary term is to be deleted from the model. It enables Add-Ins to permit or deny deletion of the glossary term. The notification is provided immediately before the glossary term is deleted, so that the Add-In can disable deletion of the glossary term.
public EA_OnPreDeleteGlossaryTerm ( EA Repository, EA Info ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Info EA Contains the following EventProperty objects for the glossary term to be deleted: /// TermID: A long value corresponding to Term.TermID.
return bool

EA_OnPreDeleteMethod() public method

EA_OnPreDeleteMethod notifies Add-Ins that an method is to be deleted from the model. It enables Add-Ins to permit or deny deletion of the method. This event occurs when a user deletes an method from the Project Browser or on a diagram. The notification is provided immediately before the method is deleted, so that the Add-In can disable deletion of the method.
public EA_OnPreDeleteMethod ( EA Repository, EA Info ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Info EA Contains the following EventProperty object for the Method to be deleted: /// - MethodID: A long value corresponding to Method.MethodID.
return bool

EA_OnPreDeletePackage() public method

EA_OnPreDeletePackage notifies Add-Ins that an package is to be deleted from the model. It enables Add-Ins to permit or deny deletion of the package. This event occurs when a user attempts to permanently delete a package from the Project Browser. The notification is provided immediately before the package is deleted, so that the Add-In can disable deletion of the package.
public EA_OnPreDeletePackage ( EA Repository, EA Info ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Info EA Contains the following EventProperty object for the package to be deleted: /// - PackageID: A long value corresponding to Package.PackageID.
return bool

EA_OnPreDropFromTree() public method

When a user drags any kind of element from the Project Browser onto a diagram, EA_OnPreDropFromTree notifies the Add-In that a new item is about to be dropped onto a diagram. The notification is provided immediately before the element is dropped, so that the Add-In can override the default action that would be taken for this drag.
public EA_OnPreDropFromTree ( EA Repository, EA Info ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Info EA Contains the following EventProperty objects for the element to be created: /// · ID: A long value of the type being dropped /// · Type: A string value corresponding to type of element being dropped /// · DiagramID: A long value corresponding to the ID of the diagram to which the element is being added /// · PositionX: The X coordinate into which the element is being dropped /// · PositionY: The Y coordinate into which the element is being dropped /// · DroppedID: A long value corresponding to the ID of the element the item has been dropped onto
return bool

EA_OnPreExitInstance() public method

EA_OnPreExitInstance is not currently used.
public EA_OnPreExitInstance ( EA Repository ) : void
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
return void

EA_OnPreNewAttribute() public method

EA_OnPreNewAttribute notifies Add-Ins that a new attribute is about to be created on an element. It enables Add-Ins to permit or deny creation of the new attribute. This event occurs when a user creates a new attribute on an element by either drag-dropping from the Project Browser, using the Attributes Properties dialog, or using the in-place editor on the diagram. The notification is provided immediately before the attribute is created, so that the Add-In can disable addition of the attribute. Also look at EA_OnPostNewAttribute.
public EA_OnPreNewAttribute ( EA Repository, EA Info ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Info EA Contains the following EventProperty objects for the attribute to be created: /// - Type: A string value corresponding to Attribute.Type /// - Stereotype: A string value corresponding to Attribute.Stereotype /// - ParentID: A long value corresponding to Attribute.ParentID /// - ClassifierID: A long value corresponding to Attribute.ClassifierID.
return bool

EA_OnPreNewConnector() public method

EA_OnPreNewConnector notifies Add-Ins that a new connector is about to be created on a diagram. It enables Add-Ins to permit or deny creation of a new connector. This event occurs when a user drags a new connector from the Toolbox or Resources window, onto a diagram. The notification is provided immediately before the connector is created, so that the Add-In can disable addition of the connector. Also look at EA_OnPostNewConnector.
public EA_OnPreNewConnector ( EA Repository, EA Info ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Info EA Contains the following EventProperty objects for the connector to be created: /// - Type: A string value corresponding to Connector.Type /// - Subtype: A string value corresponding to Connector.Subtype /// - Stereotype: A string value corresponding to Connector.Stereotype /// - ClientID: A long value corresponding to Connector.ClientID /// - SupplierID: A long value corresponding to Connector.SupplierID /// - DiagramID: A long value corresponding to Connector.DiagramID. ///
return bool

EA_OnPreNewDiagram() public method

EA_OnPreNewDiagram notifies Add-Ins that a new diagram is about to be created. It enables Add-Ins to permit or deny creation of the new diagram. The notification is provided immediately before the diagram is created, so that the Add-In can disable addition of the diagram. Also look at EA_OnPostNewDiagram.
public EA_OnPreNewDiagram ( EA Repository, EA Info ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Info EA Contains the following EventProperty objects for the diagram to be created: /// - Type: A string value corresponding to Diagram.Type /// - ParentID: A long value corresponding to Diagram.ParentID /// - PackageID: A long value corresponding to Diagram.PackageID.
return bool

EA_OnPreNewDiagramObject() public method

EA_OnPreNewDiagramObject notifies Add-Ins that a new diagram object is about to be dropped on a diagram. It enables Add-Ins to permit or deny creation of the new object. This event occurs when a user drags an object from the Enterprise Architect Project Browser or Resources window onto a diagram. The notification is provided immediately before the object is created, so that the Add-In can disable addition of the object. Also look at EA_OnPostNewDiagramObject.
public EA_OnPreNewDiagramObject ( EA Repository, EA Info ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Info EA Contains the following EventProperty objects for the object to be created: /// - Type: A string value corresponding to Object.Type /// - Stereotype: A string value corresponding to Object.Stereotype /// - ParentID: A long value corresponding to Object.ParentID /// - DiagramID: A long value corresponding to the ID of the diagram to which the object is being added.
return bool

EA_OnPreNewElement() public method

EA_OnPreNewElement notifies Add-Ins that a new element is about to be created on a diagram. It enables Add-Ins to permit or deny creation of the new element. This event occurs when a user drags a new element from the Toolbox or Resources window onto a diagram. The notification is provided immediately before the element is created, so that the Add-In can disable addition of the element. Also look at EA_OnPostNewElement.
public EA_OnPreNewElement ( EA Repository, EA Info ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Info EA Contains the following EventProperty objects for the element to be created: /// - Type: A string value corresponding to Element.Type /// - Stereotype: A string value corresponding to Element.Stereotype /// - ParentID: A long value corresponding to Element.ParentID /// - DiagramID: A long value corresponding to the ID of the diagram to which the element is being added.
return bool

EA_OnPreNewGlossaryTerm() public method

EA_OnPreNewGlossaryTerm notifies Add-Ins that a new glossary term is about to be created. It enables Add-Ins to permit or deny creation of the new glossary term. The notification is provided immediately before the glossary term is created, so that the Add-In can disable addition of the element. Also look at EA_OnPostNewGlossaryTerm.
public EA_OnPreNewGlossaryTerm ( EA Repository, EA Info ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Info EA Contains the following EventProperty objects for the glossary term to be deleted: /// TermID: A long value corresponding to Term.TermID.
return bool

EA_OnPreNewMethod() public method

EA_OnPreNewMethod notifies Add-Ins that a new method is about to be created on an element. It enables Add-Ins to permit or deny creation of the new method. This event occurs when a user creates a new method on an element by either drag-dropping from the Project Browser, using the method Properties dialog, or using the in-place editor on the diagram. The notification is provided immediately before the method is created, so that the Add-In can disable addition of the method. Also look at EA_OnPostNewMethod.
public EA_OnPreNewMethod ( EA Repository, EA Info ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Info EA Contains the following EventProperty objects for the method to be created: /// - ReturnType: A string value corresponding to Method.ReturnType /// - Stereotype: A string value corresponding to Method.Stereotype /// - ParentID: A long value corresponding to Method.ParentID /// - ClassifierID: A long value corresponding to Method.ClassifierID.
return bool

EA_OnPreNewPackage() public method

EA_OnPreNewPackage notifies Add-Ins that a new package is about to be created in the model. It enables Add-Ins to permit or deny creation of the new package. This event occurs when a user drags a new package from the Toolbox or Resources window onto a diagram, or by selecting the New Package icon from the Project Browser. The notification is provided immediately before the package is created, so that the Add-In can disable addition of the package. Also look at EA_OnPostNewPackage.
public EA_OnPreNewPackage ( EA Repository, EA Info ) : bool
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Info EA Contains the following EventProperty objects for the package to be created: /// Stereotype: A string value corresponding to Package.Stereotype /// ParentID: A long value corresponding to Package.ParentID /// DiagramID: A long value corresponding to the ID of the diagram to which the package is being added.
return bool

EA_OnRetrieveModelTemplate() public method

EA_OnRetrieveModelTemplate requests that an Add-In pass a model template to Enterprise Architect. This event occurs when a user executes the Add a New Model Using Wizard command to add a model that has been defined by an MDG Technology. See the Incorporate Model Templates topic for details of how to define such model templates.
public EA_OnRetrieveModelTemplate ( EA Repository, string sLocation ) : string
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
sLocation string The name of the template requested. This should match the location attribute in the [ModelTemplates] section of an MDG Technology File. For more information, see the Incorporate Model Templates in a Technology topic.
return string

EA_OnRunAttributeRule() public method

This event is triggered once for each rule defined in EA_OnInitializeUserRules to be performed on each attribute in the selection being validated. If you don't want to perform the rule defined by RuleID on the given attribute, then simply return without performing any action. On performing any validation, if a validation error is found, use the Repository.ProjectInterface.PublishResult method to notify Enterprise Architect.
public EA_OnRunAttributeRule ( EA Repository, string RuleID, string AttributeGUID, long ObjectID ) : void
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
RuleID string The ID that was passed into the Project.DefineRule command.
AttributeGUID string The GUID of the attribute to potentially perform validation on. Use the Repository.GetAttributeByGUID method to retrieve the attribute object.
ObjectID long The ID of the object that owns the given attribute. Use the Repository.GetObjectByID method to retrieve the object.
return void

EA_OnRunConnectorRule() public method

This event is triggered once for each rule defined in EA_OnInitializeUserRules to be performed on each connector in the selection being validated. If you don't want to perform the rule defined by RuleID on the given connector, then simply return without performing any action. On performing any validation, if a validation error is found, use the Repository.ProjectInterface.PublishResult method to notify Enterprise Architect.
public EA_OnRunConnectorRule ( EA Repository, string RuleID, long ConnectorID ) : void
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
RuleID string The ID that was passed into the Project.DefineRule command.
ConnectorID long The ID of the connector to potentially perform validation on. Use the Repository.GetConnectorByID method to retrieve the connector object.
return void

EA_OnRunDiagramRule() public method

This event is triggered once for each rule defined in EA_OnInitializeUserRules to be performed on each diagram in the selection being validated. If you don't want to perform the rule defined by RuleID on the given diagram, then simply return without performing any action. On performing any validation, if a validation error is found, use the Repository.ProjectInterface.PublishResult method to notify Enterprise Architect.
public EA_OnRunDiagramRule ( EA Repository, string RuleID, long DiagramID ) : void
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
RuleID string The ID that was passed into the Project.DefineRule command.
DiagramID long The ID of the diagram to potentially perform validation on. Use the Repository.GetDiagramByID method to retrieve the diagram object.
return void

EA_OnRunElementRule() public method

This event is triggered once for each rule defined in EA_OnInitializeUserRules to be performed on each element in the selection being validated. If you don't want to perform the rule defined by RuleID on the given element, then simply return without performing any action. On performing any validation, if a validation error is found, use the Repository.ProjectInterface.PublishResult method to notify Enterprise Architect. Also look at EA_OnInitializeUserRules.
public EA_OnRunElementRule ( EA Repository, string RuleID, EA Element ) : void
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
RuleID string The ID that was passed into the Project.DefineRule command.
Element EA The element to potentially perform validation on.
return void

EA_OnRunMethodRule() public method

This event is triggered once for each rule defined in EA_OnInitializeUserRules to be performed on each method in the selection being validated. If you don't want to perform the rule defined by RuleID on the given method, then simply return without performing any action. On performing any validation, if a validation error is found, use the Repository.ProjectInterface.PublishResult method to notify Enterprise Architect.
public EA_OnRunMethodRule ( EA Repository, string RuleID, string MethodGUID, long ObjectID ) : void
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
RuleID string The ID that was passed into the Project.DefineRule command.
MethodGUID string The GUID of the method to potentially perform validation on. Use the Repository.GetMethodByGUID method to retrieve the method object.
ObjectID long The ID of the object that owns the given method. Use the Repository.GetObjectByID method to retrieve the object.
return void

EA_OnRunPackageRule() public method

This event is triggered once for each rule defined in EA_OnInitializeUserRules to be performed on each package in the selection being validated. If you don't want to perform the rule defined by RuleID on the given package, then simply return without performing any action. On performing any validation, if a validation error is found, use the Repository.ProjectInterface.PublishResult method to notify Enterprise Architect.
public EA_OnRunPackageRule ( EA Repository, string RuleID, long PackageID ) : void
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
RuleID string The ID that was passed into the Project.DefineRule command.
PackageID long The ID of the package to potentially perform validation on. Use the Repository.GetPackageByID method to retrieve the package object.
return void

EA_OnRunParameterRule() public method

This event is triggered once for each rule defined in EA_OnInitializeUserRules to be performed on each parameter in the selection being validated. If you don't want to perform the rule defined by RuleID on the given parameter, then simply return without performing any action. On performing any validation, if a validation error is found, use the Repository.ProjectInterface.PublishResult parameter to notify Enterprise Architect.
public EA_OnRunParameterRule ( EA Repository, string RuleID, string ParameterGUID, string MethodGUID, long ObjectID ) : void
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
RuleID string The ID that was passed into the Project.DefineRule command.
ParameterGUID string The GUID of the parameter to potentially perform validation on. Use the Repository.GetParameterByGUID parameter to retrieve the parameter object.
MethodGUID string The GUID of the method that owns the given parameter. Use the Repository.GetMethodByGuid method to retrieve the method object.
ObjectID long The ID of the object that owns the given parameter. Use the Repository.GetObjectByID parameter to retrieve the object.
return void

EA_OnStartValidation() public method

EA_OnStartValidation notifies Add-Ins that a user has invoked the model validation command from Enterprise Architect.
public EA_OnStartValidation ( EA Repository, object Args ) : void
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
Args object Contains a (Variant) list of Rule Categories that are active for the current invocation of model validation.
return void

EA_OnTabChanged() public method

EA_OnTabChanged notifies Add-Ins that the currently open tab has changed. Diagrams do not generate the message when they are first opened - use the broadcast event EA_OnPostOpenDiagram for this purpose.
public EA_OnTabChanged ( EA Repository, string TabName, int DiagramID ) : void
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
TabName string The name of the tab to which focus has been switched.
DiagramID int The diagram ID, or 0 if switched to an Add-In tab.
return void

EA_QueryAvailableCompartments() public method

This event occurs when Enterprise Architect's diagrams are refreshed. It is a request for the Add-In to provide a list of user-defined compartments. The EA_GetCompartmentData event then queries each object for the data to display in each user-defined compartment.
public EA_QueryAvailableCompartments ( EA Repository ) : object
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
return object

EA_ShowHelp() public method

The EA_ShowHelp event enables the Add-In to show a help topic for a particular menu option. When the user has an Add-In menu option selected, pressing [F1] can be delegated to the required Help topic by the Add-In and a suitable help message shown. This event is raised when the user presses [F1] on a menu option that is not a parent menu. Also look at EA_GetMenuItems.
public EA_ShowHelp ( EA Repository, string MenuLocation, string MenuName, string ItemName ) : void
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
MenuLocation string String representing the part of the user interface that brought up the menu. /// Can be Treeview, MainMenu or Diagram.
MenuName string The name of the parent menu for which sub-items are to be defined. In the case of the top-level menu it is an empty string.
ItemName string The name of the option actually clicked, for example, Create a New Invoice.
return void

MDG_BuildProject() public method

MDG_BuildProject enables the Add-In to handle file changes caused by generation. This function is called in response to a user selecting the Add-Ins | Build Project menu option. Respond to this event by compiling the project source files into a running application. Also look at MDG_RunExe.
public MDG_BuildProject ( EA Repository, string PackageGuid ) : void
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
PackageGuid string The GUID identifying the Enterprise Architect package sub-tree that is controlled by the Add-In.
return void

MDG_Connect() public method

MDG_Connect enables the Add-In to handle user driven request to connect a model branch to an external application. This function is called when the user attempts to connect a particular Enterprise Architect package to an as yet unspecified external project. This event enables the Add-In to interact with the user to specify such a project. The Add-In is responsible for retaining the connection details, which should be stored on a per-user or per-workstation basis. That is, users who share a common Enterprise Architect model over a network should be able to connect and disconnect to external projects independently of one another. The Add-In should therefore not store connection details in an Enterprise Architect repository. A suitable place to store such details would be: SHGetFolderPath(..CSIDL_APPDATA..)\AddinName. The PackageGuid parameter is the same identifier as required for most events relating to the MDG Add-In. Therefore it is recommended that the connection details be indexed using the PackageGuid value. The PackageID parameter is provided to aid fast retrieval of package details from Enterprise Architect, should this be required. Also look at MDG_Disconnect.
public MDG_Connect ( EA Repository, long PackageID, string PackageGuid ) : long
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
PackageID long The PackageID of the Enterprise Architect package the user has requested to have connected to an external project.
PackageGuid string The unique ID identifying the project provided by the Add-In when a connection to a project branch of an Enterprise Architect model was first established.
return long

MDG_Disconnect() public method

MDG_Disconnect enables the Add-In to respond to user requests to disconnect the model branch from an external project. This function is called when the user attempts to disconnect an associated external project. The Add-In is required to delete the details of the connection. Also look at MDG_Connect.
public MDG_Disconnect ( EA Repository, string PackageGuid ) : long
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
PackageGuid string The GUID identifying the Enterprise Architect package sub-tree that is controlled by the Add-In.
return long

MDG_GetConnectedPackages() public method

MDG_GetConnectedPackages enables the Add-In to return a list of current connection between Enterprise Architect and an external application. This function is called when the Add-In is first loaded, and is expected to return a list of the available connections to external projects for this Add-In. Also look at MDG_Connect
public MDG_GetConnectedPackages ( EA Repository ) : object
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
return object

MDG_GetProperty() public method

MDG_GetProperty provides miscellaneous Add-In details to Enterprise Architect. This function is called by Enterprise Architect to poll the Add-In for information relating to the PropertyName. This event should occur in as short a duration as possible as Enterprise Architect does not cache the information provided by the function. Values corresponding to the following PropertyNames must be provided: - IconID - Return the name of a DLL and a resource identifier in the format #ResID, where the resource ID indicates an Icon; for example, c:\program files\myapp\myapp.dlll#101 - Language - Return the default language that Classes should be assigned when they are created in Enterprise Architect - HiddenMenus - Return one or more values from the MDGMenus enumeration to hide menus that do not apply to your Add-In. For example: if( PropertyName == "HiddenMenus" ) return mgBuildProject + mgRun;
public MDG_GetProperty ( EA Repository, string PackageGuid, string PropertyName ) : object
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
PackageGuid string The GUID identifying the Enterprise Architect package sub-tree that is controlled by the Add-In.
PropertyName string The name of the property that is used by Enterprise Architect. See Details for the possible values.
return object

MDG_Merge() public method

MDG_Merge enables the Add-In to jointly handle changes to both the model branch and the code project that the model branch is connected to. This event should be called whenever the user has asked to merge their model branch with its connected code project, or whenever the user has established a new connection to a code project. The purpose of this event is to enable the Add-In to interact with the user to perform a merge between the model branch and the connected project. Also look at MDG_Connect, MDG_PreMerge and MDG_PostMerge. Merge A merge consists of three major operations: - Export: Where newly created model objects are exported into code and made available to the code project. - Import: Where newly created code objects, Classes and such things are imported into the model. - Synchronize: Where objects available both to the model and in code are jointly updated to reflect changes made in either the model, code project or both. - Synchronize Type The Synchronize operation can take place in one of four different ways. Each of these ways corresponds to a value returned by SynchType: - None: (SynchType = 0) No synchronization is to be performed - Forward: (SynchType = 1) Forward synchronization, between the model branch and the code project is to occur - Reverse: (SynchType = 2) Reverse synchronization, between the code project and the model branch is to occur - Both: (SynchType = 3) Reverse, then Forward synchronization's are to occur. Object ID Format Each of the Object IDs listed in the string arrays described above should be composed in the following format: (@namespace)*(#class)*($attribute|%operation|:property)*
public MDG_Merge ( EA Repository, string PackageGuid, object &SynchObjects, string &SynchType, object &ExportObjects, object &ExportFiles, object &ImportFiles, string &IgnoreLocked, string &Language ) : long
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
PackageGuid string The GUID identifying the Enterprise Architect package sub-tree that is controlled by the Add-In.
SynchObjects object A string array containing a list of objects (Object ID format) to be jointly synchronized between the model branch and the project. /// See summary for the format of the Object IDs.
SynchType string The value determining the user-selected type of synchronization to take place. /// See summary for a list of valid values.
ExportObjects object The string array containing the list of new model objects (in Object ID format) to be exported by Enterprise Architect to the code project.
ExportFiles object A string array containing the list of files for each model object chosen for export by the Add-In. /// Each entry in this array must have a corresponding entry in the ExportObjects parameter at the same array index, /// so ExportFiles(2) must contain the filename of the object by ExportObjects(2).
ImportFiles object A string array containing the list of code files made available to the code project to be newly imported to the model. /// Enterprise Architect imports each file listed in this array for import into the connected model branch.
IgnoreLocked string A value indicating whether to ignore any files locked by the code project (that is, "TRUE" or "FALSE".
Language string The string value containing the name of the code language supported by the code project connected to the model branch.
return long

MDG_NewClass() public method

MDG_NewClass enables the Add-In to alter details of a Class before it is created. This method is called when Enterprise Architect generates a new Class, and requires information relating to assigning the language and file path. The file path should be passed back as a return value and the language should be passed back via the language parameter. Also look at MDG_PreGenerate
public MDG_NewClass ( EA Repository, string PackageGuid, string CodeID, string &Language ) : string
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
PackageGuid string The GUID identifying the Enterprise Architect package sub-tree that is controlled by the Add-In.
CodeID string A string used to identify the code element before it is created, for more information see MDG_View.
Language string A string used to identify the programming language for the new Class. The language must be supported by Enterprise Architect.
return string

MDG_PostGenerate() public method

MDG_PostGenerate enables the Add-In to handle file changes caused by generation. This event is called after Enterprise Architect has prepared text to replace the existing contents of a file. Responding to this event enables the Add-In to write to the linked application's user interface rather than modify the file directly. When the contents of a file are changed, Enterprise Architect passes FileContents as a non-empty string. New files created as a result of code generation are also sent through this mechanism, enabling Add-Ins to add new files to the linked project's file list. When new files are created Enterprise Architect passes FileContents as an empty string. When a non-zero is returned by this function, the Add-In has successfully written the contents of the file. A zero value for the return indicates to Enterprise Architect that the file must be saved. Also look at MDG_PreGenerate.
public MDG_PostGenerate ( EA Repository, string PackageGuid, string FilePath, string FileContents ) : long
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
PackageGuid string The GUID identifying the Enterprise Architect package sub-tree that is controlled by the Add-In.
FilePath string The path of the file Enterprise Architect intends to overwrite.
FileContents string A string containing the proposed contents of the file.
return long

MDG_PostMerge() public method

MDG_PostMerge is called after a merge process has been completed. This function is called by Enterprise Architect after the merge process has been completed. Note: File save checking should not be performed with this function, but should be handled by MDG_PreGenerate, MDG_PostGenerate and MDG_PreReverse. Also look at MDG_PreMerge and MDG_Merge.
public MDG_PostMerge ( EA Repository, string PackageGuid ) : long
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
PackageGuid string The GUID identifying the Enterprise Architect package sub-tree that is controlled by the Add-In.
return long

MDG_PreGenerate() public method

MDG_PreGenerate enables the Add-In to deal with unsaved changes. This function is called immediately before Enterprise Architect attempts to generate files from the model. A possible use of this function would be to prompt the user to save unsaved source files. Also look at MDG_PostGenerate.
public MDG_PreGenerate ( EA Repository, string PackageGuid ) : long
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
PackageGuid string The GUID identifying the Enterprise Architect package sub-tree that is controlled by the Add-In.
return long

MDG_PreMerge() public method

MDG_PreMerge is called after a merge process has been initiated by the user and before Enterprise Architect performs the merge process. This event is called after a user has performed their interactions with the merge screen and has confirmed the merge with the OK button, but before Enterprise Architect performs the merge process using the data provided by the MDG_Merge call, before any changes have been made to the model or the connected project. This event is made available to provide the Add-In with the opportunity to generally set internal Add-In flags to augment the MDG_PreGenerate, MDG_PostGenerate and MDG_PreReverse events. Note: File save checking should not be performed with this function, but should be handled by MDG_PreGenerate, MDG_PostGenerate and MDG_PreReverse. Also look at MDG_Merge and MDG_PostMerge.
public MDG_PreMerge ( EA Repository, string PackageGuid ) : long
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
PackageGuid string The GUID identifying the Enterprise Architect package sub-tree that is controlled by the Add-In.
return long

MDG_PreReverse() public method

MDG_PreReverse enables the Add-In to save file changes before being imported into Enterprise Architect. This function operates on a list of files that are about to be reverse-engineered into Enterprise Architect. If the user is working on unsaved versions of these files in an editor, you could either prompt the user or save automatically. Also look at MDG_PostGenerate and MDG_PreGenerate.
public MDG_PreReverse ( EA Repository, string PackageGuid, object FilePaths ) : void
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
PackageGuid string The GUID identifying the Enterprise Architect package sub-tree that is controlled by the Add-In.
FilePaths object A string array of filepaths pointed to the files that are to be reverse engineered.
return void

MDG_RunExe() public method

MDG_RunExe enables the Add-In to run the target application. This function is called when the user selects the Add-Ins | Run Exe menu option. Respond to this event by launching the compiled application. Also look at MDG_BuildProject.
public MDG_RunExe ( EA Repository, string PackageGuid ) : void
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
PackageGuid string The GUID identifying the Enterprise Architect package sub-tree that is controlled by the Add-In.
return void

MDG_View() public method

MDG_View enables the Add-In to display user specified code elements. This function is called by Enterprise Architect when the user asks to view a particular code element. This enables the Add-In to present that element in its own way, usually in a code editor.
public MDG_View ( EA Repository, string PackageGuid, string CodeID ) : long
Repository EA An EA.Repository object representing the currently open Enterprise Architect model. /// Poll its members to retrieve model data and user interface status information.
PackageGuid string The GUID identifying the Enterprise Architect package sub-tree that is controlled by the Add-In.
CodeID string Identifies the code element in the following format: /// [type]ElementPart[type]ElementPart... /// where each element is proceeded with a token identifying its type: /// @ -namespace /// # - Class /// $ - attribute /// % - operation /// For example if a user has selected the m_Name attribute of Class1 located in namespace Name1, the class ID would be passed through in the following format: /// @Name1#Class1%m_Name
return long

addNewScriptFunction() public method

adds a script function for the given methodinfo to the given script
public addNewScriptFunction ( MethodInfo operation, Script script ) : ScriptFunction
operation System.Reflection.MethodInfo
script Script the script to which the function should be added
return EAAddinFramework.EASpecific.ScriptFunction