预订演示

请注意 : 本帮助页面不适用于最新版本的Enterprise Architect. 最新的帮助文档在这里.

前页 后页

MDG_PostGenerate

Add-Ins can use MDG_PostGenerate 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, so the Add-Ins can 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.

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 these parameters.

Parameter

Type

See also

Repository

EA.Repository
Direction: IN
Description: An EA.Repository object representing the currently open Enterprise Architect model. Poll its members to retrieve model data and user interface status information.
Repository Class

PackageGuid

String
Direction: IN
Description: The GUID identifying the Enterprise Architect Package sub-tree that is controlled by the Add-In.

FilePath

String
Direction: IN
Description: The path of the file Enterprise Architect intends to overwrite.

FileContents

String
Direction: IN
Description: A string containing the proposed contents of the file.

Return Value

The return value depends on the type of event that this function is responding to (see introduction). This function is required to handle two separate and distinct cases.

Learn more