System.IO.Compression.DeflateStreamAsyncResult.InvokeCallback C# (CSharp) Method

InvokeCallback() private method

private InvokeCallback ( bool completedSynchronously, object result ) : void
completedSynchronously bool
result object
return void
        internal void InvokeCallback(bool completedSynchronously, object result) {
            Complete(completedSynchronously, result);
        }

Same methods

DeflateStreamAsyncResult::InvokeCallback ( object result ) : void

Usage Example

示例#1
0
 public override IAsyncResult BeginRead(byte[] array, int offset, int count, AsyncCallback asyncCallback, object asyncState) {
     IAsyncResult result2;
     this.EnsureDecompressionMode();
     if (this.asyncOperations != 0) {
         throw new InvalidOperationException("Only one asynchronous reader is allowed time at one time.");
     }
     Interlocked.Increment(ref this.asyncOperations);
     try {
         this.ValidateParameters(array, offset, count);
         DeflateStreamAsyncResult state = new DeflateStreamAsyncResult(this, asyncState, asyncCallback, array, offset, count);
         state.isWrite = false;
         int result = this.inflater.Inflate(array, offset, count);
         if (result != 0) {
             state.InvokeCallback(true, result);
             return state;
         }
         if (this.inflater.Finished()) {
             state.InvokeCallback(true, 0);
             return state;
         }
         this._stream.BeginRead(this.buffer, 0, this.buffer.Length, this.m_CallBack, state);
         state.m_CompletedSynchronously &= state.IsCompleted;
         result2 = state;
     }
     catch {
         Interlocked.Decrement(ref this.asyncOperations);
         throw;
     }
     return result2;
 }
All Usage Examples Of System.IO.Compression.DeflateStreamAsyncResult::InvokeCallback