Exemplo n.º 1
0
        /// <summary>
        /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// consolecanceleventhandler.BeginInvoke(sender, e, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginInvoke(this ConsoleCancelEventHandler consolecanceleventhandler, Object sender, ConsoleCancelEventArgs e, AsyncCallback callback)
        {
            if (consolecanceleventhandler == null)
            {
                throw new ArgumentNullException("consolecanceleventhandler");
            }

            return(consolecanceleventhandler.BeginInvoke(sender, e, callback, null));
        }