Пример #1
0
 public void SetModels(Game game, Emulator emu)
 {
     gameModel = game;
     emuModel = emu;
     UpdateView ();
 }
Пример #2
0
    /// <summary>
    /// Called when a game is selected in the libaray
    /// </summary>
    /// <param name="game">Game.</param>
    protected void OnGameSelected(Game game, TreeModel model, TreeIter child)
    {
        activeEmulator = null;
        activeGame = game;

        TreeIter iter;
        if (model.IterParent (out iter, child))
            activeEmulator = (Emulator)model.GetValue (iter, 0);

        GameView.SetModels (activeGame, activeEmulator);

        SetActionSensitivity ();
    }
Пример #3
0
 /// <summary>
 /// Removes the emulator from the list, after warning the user about the implications of doing so.
 /// </summary>
 /// <param name="sender">Sender.</param>
 /// <param name="e">E.</param>
 protected void RemoveEmulatorButtonOnActivate(object sender, EventArgs e)
 {
     MessageDialog md = new MessageDialog(this,
         DialogFlags.Modal,
         MessageType.Warning,
         ButtonsType.YesNo,
         true,
         string.Format("<b>Warning!</b> Removing <i>{0}</i> will also remove all games and information associated with this emulator. Are you sure you want to continue?", activeEmulator.name)
     );
     if ((ResponseType)md.Run () == ResponseType.Yes)
     {
         EmulatorController.emulators.Remove (activeEmulator);
         UpdateTree ();
         activeEmulator = null;
     }
     md.Destroy ();
 }
Пример #4
0
 /// <summary>
 /// Called when an emulator is selected in the libaray
 /// </summary>
 /// <param name="emu">Emu.</param>
 protected void OnEmulatorSelected(Emulator emu, TreeModel model)
 {
     activeEmulator = emu;
     activeGame = null;
     SetActionSensitivity ();
 }