System.IO.FileStreamAsyncResult.CallUserCallback C# (CSharp) 메소드

CallUserCallback() 개인적인 메소드

private CallUserCallback ( ) : void
리턴 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

예제 #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