Inserting Events Stubs in CS
From Ribbon Commander Documentation
Revision as of 15:54, 15 March 2013 by Rxdff15551 bb53 (Talk | contribs)
The .NET framework makes it easy to event stubs by using operator +=.
Consider the simple example below:
class SubscribeToEvents
{
public SubscribeToEvents()
{
// Create a new button
rxButton myButton = new rxButton();
// Subscribe to its 'onAction' event
myButton.OnActionEvent += myButton_OnActionEvent;
}
// The event stub
void myButton_OnActionEvent(IRibbonControl control)
{
throw new NotImplementedException();
}
}
- type
_myButton.OnActionEvent +=
- intellisense picks up and prompts you to press tab to insert the stub:
- Press tab twice to insert the delegate stub and change it to display the message box as above
- type