预订演示

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

前页 后页

EA_OnPreNewMethod

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 Browser window, using the 'Operations' tab of the Features window, 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.

Syntax

Function EA_OnPreNewMethod (Repository As EA.Repository, Info As EA.EventProperties) As Boolean
The EA_OnPreNewMethod 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

Info

EA.EventProperties
Direction: IN
Description: Contains these 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

EventProperties Class

Return Value


  • Return True to enable addition of the new method to the model

  • Return False to disable addition of the new method

Learn more