System.Net.Security.NegoState.CheckThrow C# (CSharp) Method

CheckThrow() private method

private CheckThrow ( bool authSucessCheck ) : void
authSucessCheck bool
return void
        internal void CheckThrow(bool authSucessCheck)
        {
            if (_exception != null)
            {
                throw _exception;
            }

            if (authSucessCheck && !IsAuthenticated)
            {
                throw new InvalidOperationException(SR.net_auth_noauth);
            }
        }

Usage Example

Example #1
0
        //
        //
        public override int Read(byte[] buffer, int offset, int count)
        {
#if DEBUG
            using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.Sync)) {
#endif
            _NegoState.CheckThrow(true);

            if (!_NegoState.CanGetSecureStream)
            {
                return(InnerStream.Read(buffer, offset, count));
            }

            return(ProcessRead(buffer, offset, count, null));

#if DEBUG
        }
#endif
        }