Exemplo n.º 1
0
 private void btnAddMap_Click( object sender, EventArgs e )
 {
     if ( _dlgAdd.ShowDialog() != DialogResult.OK ) return;
     var k = new Map {
         Key = (Keys) _dlgAdd.cmbKey.SelectedItem,
         Path = _dlgAdd.txtPath.Text
     };
     if ( !_core.AddMap( k ) ) {
         MessageBox.Show( "Failed to add map", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error );
         return;
     }
     RefreshKeymaps();
 }
Exemplo n.º 2
0
 public bool AddMap( Map map )
 {
     if (!_maps.ContainsKey( map.Key ))
         _maps.Add( map.Key, map );
     return true;
 }