MDG_PostGenerate

Return to Introduction  Previous page  Next page

MDG_PostGenerate

 

The MDG_PostGenerate enables the Add-In to handle file changes caused by generation.

 

Syntax

 

Function MDG_PostGenerate(Repository As EA.Repository, PackageGuid As String, FilePath As String, FileContents As String) As Long

 

The MDG_PostGenerate function syntax contains the following elements

 

 

Parameter

Type

Direction

Description

Repository

EA.Repository

 

IN

An EA.Repository object representing the currently open EA model. Poll its members to retrieve model data and user interface status information.

 

PackageGuid

 

String

IN

The GUID identifying the EA package sub-tree that is controlled by the Add-In.

 

FilePath

 

String

IN

The path of the file EA intends to overwrite.

FileContents

 

String

IN

A string containing the proposed contents of the file.

 

Return Value

 

Return a value depends on the type of event that this function is responding to (see Details). This function is required to handle two sperate and distinct cases.

 

Details

 

This event is called after EA 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 is 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.

See Also