System.IO.FileStreamAsyncResult.CallUserCallback C# (CSharp) Méthode

CallUserCallback() private méthode

private CallUserCallback ( ) : void
Résultat void
        internal void CallUserCallback()
        {
            // Convenience method for me, since I have to do this in a number 
            // of places in the buffering code for fake IAsyncResults.   
            // AsyncFSCallback intentionally does not use this method.
            
            if (_userCallback != null) {
                // Call user's callback on a threadpool thread.  
                // Set completedSynchronously to false, since it's on another 
                // thread, not the main thread.
                _completedSynchronously = false;
                ThreadPool.QueueUserWorkItem(new WaitCallback(CallUserCallbackWorker));
            }
            else {
                _isComplete = true;
                if (_waitHandle != null)
                    _waitHandle.Set();
            }
        }

Usage Example

Exemple #1
0
            internal static FileStreamAsyncResult CreateBufferedReadResult(int numBufferedBytes, AsyncCallback userCallback, Object userStateObject, bool isWrite)
            {
                FileStreamAsyncResult asyncResult = new FileStreamAsyncResult(numBufferedBytes, userCallback, userStateObject, isWrite);

                asyncResult.CallUserCallback();
                return(asyncResult);
            }
All Usage Examples Of System.IO.FileStreamAsyncResult::CallUserCallback