public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state) { var ar = new ProgressStreamAsyncResult() { ByteCount = count }; ar.InnerAsyncResult = this.innerStream.BeginWrite(buffer, offset, count, x => { ar.InnerAsyncResult = x; callback(ar); }, state); return(ar); }
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state) { var ar = new ProgressStreamAsyncResult() { ByteCount = count }; ar.InnerAsyncResult = this.innerStream.BeginWrite(buffer, offset, count, x => { ar.InnerAsyncResult = x; callback(ar); }, state); return ar; }