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

            return(sendorpostcallback.BeginInvoke(state, callback, null));
        }