Esempio n. 1
0
        public void InitForm(MethodDefinition md, int start, int end)
        {
            _method = md;
            _start  = start;
            _end    = end;

            Collection <Instruction> ic = _method.Body.Instructions;

            InsUtils.InitInstructionsCombobox(cboStart, _method, ic[_start], ref instructionsStr);
            InsUtils.InitInstructionsCombobox(cboEnd, _method, ic[_end], ref instructionsStr);

            InsUtils.InitInstructionsCombobox(cboTo, _method, null, ref instructionsStr);
        }
Esempio n. 2
0
        public void InitForm(MethodDefinition md, int ehIndex)
        {
            if (_method == md && _ehIndex == ehIndex)
            {
                return;
            }

            _method  = md;
            _ehIndex = ehIndex;
            if (_ehIndex < 0)
            {
                _eh           = new ExceptionHandler(ExceptionHandlerType.Catch);
                _eh.CatchType = _method.Module.Import(typeof(System.Exception));
                InitTypes(ExceptionHandlerType.Catch);
            }
            else
            {
                _eh = _method.Body.ExceptionHandlers[_ehIndex];
                if (_eh.CatchType == null)
                {
                    _eh.CatchType = _method.Module.Import(typeof(System.Exception));
                }
                InitTypes(_eh.HandlerType);
            }

            txtCatchType.Text = _eh.CatchType.FullName;

            InsUtils.InitInstructionsCombobox(cboTryStart, _method, _eh.TryStart, ref instructionsStr);
            InsUtils.InitInstructionsCombobox(cboTryEnd, _method, _eh.TryEnd, ref instructionsStr);

            InsUtils.InitInstructionsCombobox(cboHandlerStart, _method, _eh.HandlerStart, ref instructionsStr);
            InsUtils.InitInstructionsCombobox(cboHandlerEnd, _method, _eh.HandlerEnd, ref instructionsStr);

            InsUtils.InitInstructionsCombobox(cboFilterStart, _method, _eh.FilterStart, ref instructionsStr);
            //InsUtils.InitInstructionsCombobox(cboFilterEnd, _method, _eh.FilterEnd, ref instructionsStr);
        }