예제 #1
0
        private void OnNewMapSelected(object sender, EventArgs e)
        {
            var dlg = new NewMapDialog();

            switch (_state.LastNewMapType)
            {
            case 0:
                dlg._radioSingleTileMap.IsPressed = true;
                break;

            case 1:
                dlg._radioGeneratedMap.IsPressed = true;
                break;
            }

            dlg.Closed += (s, a) =>
            {
                if (!dlg.Result)
                {
                    return;
                }

                try
                {
                    if (dlg._radioSingleTileMap.IsPressed)
                    {
                        throw new NotImplementedException();
                        _state.LastNewMapType = 0;
                    }
                    else
                    {
                        OnNewGeneratedMap();
                        _state.LastNewMapType = 1;
                    }
                }
                catch (Exception ex)
                {
                    ReportError(ex.Message);
                }
            };

            dlg.ShowModal(_desktop);
        }
예제 #2
0
 private void NewMapItemOnClicked(object sender, EventArgs eventArgs)
 {
     _newMapDialog = new NewMapDialog();
     _newMapDialog.ShowModal(_desktop);
     _newMapDialog.ButtonOk.Click += NewOnClicked;
 }