イベント ハンドラは、OnEvent コールバックによって実装されます。 すべての OnEvent コールバックには同一のサインがあり、コールバックは Context または Context オブジェクトを引数として取得し、True または 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
保存、読み込み、書き出しなどの操作の場合、OnEvent の戻り値は、操作を中断するかどうかを指定します。 操作を中断する場合は、True を返します。それ以外の場合は、False を返して操作の続行を許可します。