// -------------------------------------------------------------------------------------------------------------------------------- private void Load_Game_Button_Click(object sender, EventArgs e) { PAPIGame selectedGame = null; foreach (KeyValuePair <PAPIGame, Button> gameButton in _gameButtons) { if (gameButton.Value == (Button)sender) { selectedGame = gameButton.Key; break; } } if (selectedGame == null) { throw new GameNotFoundException("There is no game for the clicked button"); } WfLogger.Log(this, LogLevel.DEBUG, "Button 'Load' was clicked, open Popup"); PAPIApplication.StartSession(selectedGame); ((ShowGameOverviewView)ViewController.showGameOverviewView).Open(this); }