Ejemplo n.º 1
0
        private void NewExceptionHandlerEditor(EditExceptionHandlerMode mode)
        {
            NewExceptionHandler       = null;
            _editExceptionHandlerMode = mode;
            DataGridViewSelectedRowCollection selectedRows = dgBody.SelectedRows;

            if (selectedRows.Count > 0)
            {
                EditedExceptionHandlerIndex = dgBody.SelectedRows.TopmostRow().Index -
                                              CurrentAssembly.Method.Body.Instructions.Count;
            }

            if (mode == EditExceptionHandlerMode.Edit)
            {
                var form =
                    new EditExceptionHandlerForm(
                        CurrentAssembly.Method.Body.ExceptionHandlers[
                            (dgBody.SelectedRows.TopmostRow().Index -
                             CurrentAssembly.Method.Body.Instructions.Count)]);
                form.FormClosed += EditExceptionHandlerForm_FormClosed;
                form.ShowDialog();
            }
            else
            {
                var form = new EditExceptionHandlerForm();
                form.FormClosed += EditExceptionHandlerForm_FormClosed;
                form.ShowDialog();
            }
        }
Ejemplo n.º 2
0
        private void NewExceptionHandlerEditor(EditExceptionHandlerMode mode)
        {
            NewExceptionHandler = null;
            _editExceptionHandlerMode = mode;
            DataGridViewSelectedRowCollection selectedRows = dgBody.SelectedRows;

            if (selectedRows.Count > 0)
                EditedExceptionHandlerIndex = dgBody.SelectedRows.TopmostRow().Index -
                                              CurrentAssembly.Method.Body.Instructions.Count;

            if (mode == EditExceptionHandlerMode.Edit)
            {
                var form =
                    new EditExceptionHandlerForm(
                        CurrentAssembly.Method.Body.ExceptionHandlers[
                            (dgBody.SelectedRows.TopmostRow().Index -
                             CurrentAssembly.Method.Body.Instructions.Count)]);
                form.FormClosed += EditExceptionHandlerForm_FormClosed;
                form.ShowDialog();
            }
            else
            {
                var form = new EditExceptionHandlerForm();
                form.FormClosed += EditExceptionHandlerForm_FormClosed;
                form.ShowDialog();
            }
        }