示例#1
0
        /// <summary>
        /// Handles the double clicking on the control.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnDoubleClick(System.EventArgs e)
        {
            Point absolute   = Cursor.Position;
            Point relative   = PointToClient(absolute);
            Point gridCoords = this.GridPainter.TranslateScreenCoordinatesToGridCoordinates(relative);

            if (gridCoords == Point.Empty)
            {
                return;
            }

            GridCell gridCell = this.Grid.GetCell(gridCoords);

            if (gridCell.City != null)
            {
                CityDialog cityDetailWindow;

                cityDetailWindow = new CityDialog(gridCell.City);
                cityDetailWindow.ShowDialog(this);
            }
            else
            {
                TerrainDialog dlg = new TerrainDialog(gridCell);
                dlg.ShowDialog(this);
            }

            base.OnDoubleClick(e);
        }
        private void _goToCityButton_Click(object sender, System.EventArgs e)
        {
            CityDialog cityWindow;

            cityWindow = new CityDialog(_city);

            cityWindow.ShowDialog(this.Owner);
            this.Close();
        }