= Ignore = Disconnect an event from some particular event handling code by specifying an existing event handler (method reference) for a particular Event instance. This is the converse of [wiki:Listen]. == Grammar == {{{ ignore , }}} == Examples == {{{ #!cobra use System.Windows.Forms ... button = Button(parent=p, autoSize=true, text='One', tag=1) # connect event and handling code listen button.click, ref .clickHandler ... # disconnect event and its handling code ignore button.click, ref .clickHandler ... def clickHandler(source as Object, args as EventArgs) # doClick pass }}} Full example showing signature and event declaration and convenience method for firing/raising an event. {{{ #!cobra # delegate for ActionEvent EventHandler sig ActionEventHandler(sender as Object, args as EventArgs) class Generator # event dcl for event called Action # event Event as (EventHandler) event actionEvent as ActionEventHandler # (protected) method to raise/fire the event for this class # {on,fire}Event def _onActionEvent(args as EventArgs) # fireActionEvent raise .actionEvent, args class Listener # the event handler method do def doAction(source as Object, args as EventArgs) print 'Event received from [source]' ... def driver g = Generator() l = Listener() #tie the generator event to the Listener method listen g.actionEvent, ref l.doAction ... #untie the event and listener ignore g.actionEvent, ref l.doAction }}} == Notes == The event handler method must be a reference to a method not a method invocation.[[BR]] In practice this means that most ignore statements will have their second argument as a method name prefixed with '''ref'''. == See Also == * [wiki:Listen] * [wiki:Raise] * [wiki:AllStatements] * [wiki:LanguageTopics]