protected virtual void DoGoToEvent(GoToEventArgs a) { if (GoTo != null) { GoTo(this, a); this.Close(); } }
protected virtual void MapGoTo(object sender, GoToEventArgs a) { if (a.Sector <= dc.i.Length / dc.i.sectorSize && a.Sector >= 0) { dc.selectedSector = a.Sector; int sectorsPerRow = sectorGrid.Width / dc.sectorSquareSize; if (dc.selectedSector > sectorsPerRow) { this.gridStartRow = (dc.selectedSector / sectorsPerRow) - 1; } gridScroll.Value = (int)this.gridStartRow; sectorGrid.Invalidate(); sectorGrid.Update(); } else { MessageBox.Show("Value too large or too small."); _mapGoToForm = new MapGoTo(); _mapGoToForm.GoTo += MapGoTo; _mapGoToForm.ShowDialog(); } }