private HandlerBlock CreateHandlerBlock(IMethod method, IMethodContext context, IInstructionList code, SEHBlock block) { switch (block.Type) { case SEHFlags.Catch: { int token = block.Value; var type = context.ResolveType(method, token); if (!HasGenericExceptions && type.IsGenericContext()) { _genericFlags |= GenericFlags.HasGenericExceptions; } var h = new HandlerBlock(BlockType.Catch) { ExceptionType = type }; return(h); } case SEHFlags.Filter: { var h = new HandlerBlock(BlockType.Filter) { FilterIndex = code.GetOffsetIndex(block.Value) }; return(h); } case SEHFlags.Finally: return(new HandlerBlock(BlockType.Finally)); case SEHFlags.Fault: return(new HandlerBlock(BlockType.Fault)); default: throw new IndexOutOfRangeException(); } }
public int IndexOf(HandlerBlock handlerBlock) { return(_list.IndexOf(handlerBlock)); }
public void Add(HandlerBlock block) { block.Owner = Owner; _list.Add(block); }