Ejemplo n.º 1
0
 public void DisposeController(IGameController controller)
 {
     controller.Installed   -= Controller_Installed;
     controller.Uninstalled -= Controller_Uninstalled;
     controller.Started     -= Controller_Started;
     controller.Stopped     -= Controller_Stopped;
     controller.Dispose();
 }
Ejemplo n.º 2
0
        public void Dispose()
        {
            _controller.SoundPlayed -= OnSoundPlayed;

            foreach (var player in _soundPlayers)
            {
                player.Value.Dispose();
            }

            _controller.Dispose();
            MainContainer.Dispose();
        }
Ejemplo n.º 3
0
        public void RemoveController(IGameController controller)
        {
            controller.Installed   -= Controller_Installed;
            controller.Uninstalled -= Controller_Uninstalled;
            controller.Started     -= Controller_Started;
            controller.Starting    -= Controller_Starting;
            controller.Stopped     -= Controller_Stopped;
            try
            {
                controller.Dispose();
            }
            catch (Exception e) when(!PlayniteEnvironment.ThrowAllErrors)
            {
                logger.Error(e, $"Failed to dispose game controller {controller.GetType()}");
            }

            Controllers.Remove(controller);
        }
Ejemplo n.º 4
0
 public void Dispose()
 {
     _controller.Dispose();
 }
Ejemplo n.º 5
0
 private void frmAsteroids_Closed(object sender, EventArgs e)
 {
     _controller.Dispose();
 }