private void cmuRelocationsDelete_Click(object sender, EventArgs e) { if (lvRelocation.SelectedIndices.Count < 1) { return; } Relocations.Reloc reloc = (Relocations.Reloc)lvRelocation.SelectedItems[0].Tag; if (MessageBox.Show("Are you sure to delete the relocation address \"" + (baseAddress + reloc.offset) + "\" ?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == System.Windows.Forms.DialogResult.No) { return; } rel.DeleteRelocation(baseAddress + reloc.offset); RefreshData(); }
private void mnuRelocationsEdit_Click(object sender, EventArgs e) { if (lvRelocation.SelectedItems.Count < 1) { return; } Relocations.Reloc reloc = (Relocations.Reloc)lvRelocation.SelectedItems[0].Tag; frmEditRelocation frm = new frmEditRelocation(baseAddress + reloc.offset, reloc.type); if (frm.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return; } if (!rel.EditRelocation(frm.GetOldAddress(), frm.GetNewAddress(), frm.GetRelocType())) { MessageBox.Show("Cannot edit this address"); return; } RefreshData(); }
private void cmnuPagesDelete_Click(object sender, EventArgs e) { if (lvPage.SelectedItems.Count < 1) { return; } if (MessageBox.Show("Are you sure to delete this page ?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == System.Windows.Forms.DialogResult.No) { return; } foreach (ListViewItem item in lvRelocation.Items) { Relocations.Reloc reloc = (Relocations.Reloc)item.Tag; rel.DeleteRelocation(baseAddress + reloc.offset); } lvRelocation.Items.Clear(); lvPage.Items[lvPage.SelectedIndices[0]].Remove(); RefreshSize(); }