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(); } }
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(); } }