Ejemplo n.º 1
0
        protected sealed override void OnClick(EventArgs e)
        {
            base.OnClick(e);

            if (!IsActionable)
            {
                return;
            }

            if (DropDownMenu != null)
            {
                DropDownMenu.Close(ToolStripDropDownCloseReason.ItemClicked);
            }

            try
            {
                OnDoAction();
            }
            catch (Exception ex)
            {
                System.Diagnostics.Trace.WriteLine(ex, "Error running action - " + this.Text);
                MessageBox.Show("Error running action:" + Environment.NewLine + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }