Mono.Cecil.Cil.CodeWriter.RequiresFatSection C# (CSharp) Method

RequiresFatSection() static private method

static private RequiresFatSection ( Collection handlers ) : bool
handlers Collection
return bool
        static bool RequiresFatSection(Collection<ExceptionHandler> handlers)
        {
            for (int i = 0; i < handlers.Count; i++) {
                var handler = handlers [i];

                if (IsFatRange (handler.TryStart, handler.TryEnd))
                    return true;

                if (IsFatRange (handler.HandlerStart, handler.HandlerEnd))
                    return true;

                if (handler.HandlerType == ExceptionHandlerType.Filter
                    && IsFatRange (handler.FilterStart, handler.HandlerStart))
                    return true;
            }

            return false;
        }

Usage Example

        private void WriteExceptionHandlers()
        {
            this.Align(4);
            Collection <ExceptionHandler> exceptionHandlers = this.body.ExceptionHandlers;

            if (exceptionHandlers.Count < 21 && !CodeWriter.RequiresFatSection(exceptionHandlers))
            {
                this.WriteSmallSection(exceptionHandlers);
                return;
            }
            this.WriteFatSection(exceptionHandlers);
        }