IXMLSpyPlugIn.OnEvent
声明
OnEvent(nEventID as long, arrayParameters as SAFEARRAY(VARIANT), pXMLSpy as IDispatch) as VARIANT
描述
每次从XMLSpy引发事件时,都会调用OnEvent()。
nEventID的可能值有:
On_BeforeStartEditing | = 1 | |
On_EditingFinished | = 2 | |
On_FocusChanged | = 3 | |
On_Beforedrag | = 4 | |
On_BeforeDrop | = 5 | |
On_OpenProject | = 6 | |
On_OpenDocument | = 7 | |
On_CloseDocument | = 8 | |
On_SaveDocument | = 9 |
On_DocEditDragOver | = 10 | |
On_DocEditDrop | = 11 | |
On_DocEditKeyDown | = 12 | |
On_DocEditKeyUp | = 13 | |
On_DocEditKeyPressed | = 14 | |
On_DocEditMouseMove | = 15 | |
On_DocEditButtonUp | = 16 | |
On_DocEditButtonDown | = 17 | |
On_DocEditContextMenu | = 18 | |
On_DocEditPaste | = 19 | |
On_DocEditCut | = 20 | |
On_DocEditCopy | = 21 | |
On_DocEditClear | = 22 | |
On_DocEditSelectionChanged | = 23 |
On_DocEditDragOver | = 10 |
On_BeforeOpenProject | = 25 | |
On_BeforeOpenDocument | = 26 | |
On_BeforeSaveDocument | = 27 | |
On_BeforeCloseDocument | = 28 | |
On_ViewActivation | = 29 | |
On_DocEditKeyboardEvent | = 30 | |
On_DocEditMouseEvent | = 31 |
On_BeforeValidate | = 32 |
On_BeforeShowSuggestions | = 33 | |
On_ProjectOpened | = 34 | |
On_Char | = 35 |
On_Initialize | = 36 | |
On_Running | = 37 | |
On_Shutdown | = 38 |
On_AuthenticBeforeSave | = 39 | |
On_AuthenticContextMenuActivated | = 40 | |
On_AuthenticLoad | = 41 | |
On_AuthenticToolbarButtonClicked | = 42 | |
On_AuthenticToolbarButtonExecuted | = 43 | |
On_AuthenticUserAddedXMLNode | = 44 |
事件的名称与其在XMLSpy的脚本环境中显示的名称相同。对于IDE插件,使用的名称无关紧要。事件是使用ID值进行标识的。
arrayParameters是一个数组,其中填充了当前引发的事件的参数。单个参数的顺序、类型和含义可通过XMLSpy的脚本环境获得。脚本项目的时间模块包含4.4版本之前的所有事件的预定义函数。传递到预定义函数的参数与arrayParameters参数的数组元素是相同的。
从XMLSpy的Authentic视图引发的事件不直接传递任何参数,而是使用“event”对象。事件对象可以通过活动文档的Document对象访问。
pXMLSpy持有对XMLSpy的Application对象的调度接口的引用。
如果设置了OnEvent()的返回值,那么之后不论是IDE插件,还是脚本环境内的事件处理器都不会获取此事件。请注意,所有IDE插件都会在脚本环境之前获取/处理事件。