protected void FireActionEvent(object sender, EventArgs e) { if (OnAction != null && OnAction.GetInvocationList() != null) { OnAction(sender, e); } }
/// <summary> /// Handler for toolbar button click events. When a user clicks a /// toolbar button, the corresponding action is executed. /// </summary> /// <param name="sender">Object that caused this event.</param> /// <param name="e">Details of the event.</param> private void toolMain_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e) { if (OnAction != null && OnAction.GetInvocationList() != null) { OnAction(sender, e); } switch (toolMain.Buttons.IndexOf(e.Button)) { case PRINT: printUtility.Print(title, rtbHeader.Text, rtbConsole.Text, new Font("Courier New", 9)); break; case PRINT_PREVIEW: printUtility.Preview(title, rtbHeader.Text, rtbConsole.Text, new Font("Courier New", 9)); break; case PAGE_SETUP: printUtility.PageSetup(); break; default: // ignore other buttons break; } }