Enterprise Architect Add-in Framework Documentation
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.

Namespace: EAAddinFramework
Assembly: EAAddinFramework (in EAAddinFramework.dll) Version: 1.0.4064.9398

Syntax

C#
public virtual long MDG_PostGenerate(
	Repository Repository,
	string PackageGuid,
	string FilePath,
	string FileContents
)
Visual Basic
Public Overridable Function MDG_PostGenerate ( _
	Repository As Repository, _
	PackageGuid As String, _
	FilePath As String, _
	FileContents As String _
) As Long
Visual C++
public:
virtual long long MDG_PostGenerate(
	Repository^ Repository, 
	String^ PackageGuid, 
	String^ FilePath, 
	String^ FileContents
)

Parameters

Repository
Type: Repository
An EA.Repository object representing the currently open Enterprise Architect model. Poll its members to retrieve model data and user interface status information.
PackageGuid
Type: System..::..String
The GUID identifying the Enterprise Architect package sub-tree that is controlled by the Add-In.
FilePath
Type: System..::..String
The path of the file Enterprise Architect intends to overwrite.
FileContents
Type: System..::..String
A string containing the proposed contents of the file.

Return Value

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

See Also