Exemple #1
0
        /// <summary>
        /// Extends BeginWrite so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// pipestream.BeginWrite(buffer, offset, count, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginWrite(this AnonymousPipeClientStream pipestream, Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback)
        {
            if (pipestream == null)
            {
                throw new ArgumentNullException("pipestream");
            }

            return(pipestream.BeginWrite(buffer, offset, count, callback, null));
        }
Exemple #2
0
        /// <summary>
        /// Extends BeginWrite so that buffer offset of 0 and call to Array.Length are not needed.
        /// <example>
        /// pipestream.BeginWrite(buffer, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginWrite(this AnonymousPipeClientStream pipestream, Byte[] buffer, AsyncCallback callback)
        {
            if (pipestream == null)
            {
                throw new ArgumentNullException("pipestream");
            }

            if (buffer == null)
            {
                throw new ArgumentNullException("buffer");
            }

            return(pipestream.BeginWrite(buffer, 0, buffer.Length, callback));
        }