예제 #1
0
        /// <summary>
        /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// tabcontrolcanceleventhandler.BeginInvoke(sender, e, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginInvoke(this TabControlCancelEventHandler tabcontrolcanceleventhandler, Object sender, TabControlCancelEventArgs e, AsyncCallback callback)
        {
            if (tabcontrolcanceleventhandler == null)
            {
                throw new ArgumentNullException("tabcontrolcanceleventhandler");
            }

            return(tabcontrolcanceleventhandler.BeginInvoke(sender, e, callback, null));
        }
        protected virtual void OnSelecting(TabControlCancelEventArgs e)
        {
            TabControlCancelEventHandler eh = (TabControlCancelEventHandler)(Events[SelectingEvent]);

            if (eh != null)
            {
                eh(this, e);
            }

            if (!e.Cancel)
            {
                OnSelected(new TabControlEventArgs(SelectedTab, selected_index, TabControlAction.Selected));
            }
        }