public boolean tryRegisterListener ( Object object , boolean register ) { boolean success = false ; if ( object instanceof IPluginEvent ) { if ( register ) { registerListener ( ( IPluginEvent ) object ) ; } else { unregisterListener ( ( IPluginEvent ) object ) ; } success = true ; } if ( object instanceof IPluginEventListener ) { if ( register ) { registerListener ( ( IPluginEventListener ) object ) ; } else { unregisterListener ( ( IPluginEventListener ) object ) ; } success = true ; } return success ; }
Attempts to register or unregister an object as an event listener .