private void dataGridView1_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { if (e.Button != MouseButtons.Right) { return; } if (e.RowIndex < 0 || e.ColumnIndex < 0) { return; } var row = dataGridView1.Rows[e.RowIndex].DataBoundItem as BreakPointEntry; breakPointEntry = row; var relativeMousePosition = dataGridView1.PointToClient(Cursor.Position); MenuItem menu = new MenuItem(row.Name); menu.Enabled = false; ContextMenu m = new ContextMenu(); m.MenuItems.Add(menu); m.MenuItems.Add(new MenuItem("Copy to &Clipboard", new EventHandler(MenuItem3_Click))); m.MenuItems.Add(new MenuItem("&Delete breakpoint", new EventHandler(MenuItem1_Click))); m.Show(dataGridView1, relativeMousePosition); }
public void AddBreakPoint(string name, ulong address) { var breakpoint = new BreakPointEntry(name, address, true); breakpoints.Add(breakpoint); SimCPU.Monitor.AddBreakPoint(address); }
private void dataGridView1_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { if (e.Button != MouseButtons.Right) return; if (e.RowIndex < 0 || e.ColumnIndex < 0) return; var row = dataGridView1.Rows[e.RowIndex].DataBoundItem as BreakPointEntry; breakPointEntry = row; var relativeMousePosition = dataGridView1.PointToClient(Cursor.Position); MenuItem menu = new MenuItem(row.Name); menu.Enabled = false; ContextMenu m = new ContextMenu(); m.MenuItems.Add(menu); m.MenuItems.Add(new MenuItem("Copy to &Clipboard", new EventHandler(MenuItem3_Click))); m.MenuItems.Add(new MenuItem("&Delete breakpoint", new EventHandler(MenuItem1_Click))); m.Show(dataGridView1, relativeMousePosition); }