System.Reflection.Emit.__ExceptionInfo.GetCurrentState C# (CSharp) Method

GetCurrentState() private method

private GetCurrentState ( ) : int
return int
        internal virtual int GetCurrentState() {
            return m_currentState;
        }
    }

Usage Example

Esempio n. 1
0
        public override void BeginCatchBlock(Type exceptionType)
        {
            if (base.CurrExcStackCount == 0)
            {
                throw new NotSupportedException(Environment.GetResourceString("Argument_NotInExceptionBlock"));
            }
            __ExceptionInfo info = base.CurrExcStack[base.CurrExcStackCount - 1];

            if (info.GetCurrentState() == 1)
            {
                if (exceptionType != null)
                {
                    throw new ArgumentException(Environment.GetResourceString("Argument_ShouldNotSpecifyExceptionType"));
                }
                this.Emit(OpCodes.Endfilter);
            }
            else
            {
                if (exceptionType == null)
                {
                    throw new ArgumentNullException("exceptionType");
                }
                if (!exceptionType.GetType().IsRuntimeType)
                {
                    throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"));
                }
                Label endLabel = info.GetEndLabel();
                this.Emit(OpCodes.Leave, endLabel);
                base.UpdateStackSize(OpCodes.Nop, 1);
            }
            info.MarkCatchAddr(this.ILOffset, exceptionType);
            info.m_filterAddr[info.m_currentCatch - 1] = this.m_scope.GetTokenFor(exceptionType.TypeHandle);
        }
All Usage Examples Of System.Reflection.Emit.__ExceptionInfo::GetCurrentState