An event handler is implemented by an OnEvent callback. All OnEvent callbacks have the same signature: they get a Context or Context object as an argument, and return true or false.
XSIPLUGINCALLBACK CStatus <event_name>_OnEvent( CRef& in_ctxt ) { Context ctxt( in_ctxt ); // Your code goes here ... // Return false to perform the operation, true to abort return false; }
public class <event_name> { public bool OnEvent( Context in_ctxt ) { // Your code goes here ... // Return false to perform the operation, true to abort return false; } }
function <event_name>_OnEvent( in_ctxt ) { // Your code goes here ... // Return false to perform the operation, true to abort return false; }
def <event_name>_OnEvent( in_ctxt ): # Your code goes here ... # Return 0 (false) to perform the operation, 1 (true) to abort return 0
Function <event_name>_OnEvent( in_ctxt ) ' Your code goes here ... ' Return False to perform the operation, True to abort <event_name>_OnEvent = False End Function
For operations such as save, import, and export, the OnEvent return value specifies whether to abort the operation. Return True to abort the operation, and otherwise return False to allow the operation to continue.
You can abort the following events:
Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License