Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void Application_ApplicationExit(object sender, EventArgs e)
        {
            Trace.WriteDebugLine("[GameBase] : ApplicationExit()");

            Audio.AudioManager.Release();
            Gamepad.Dispose();

            ResourceManager.Dispose();
            Trace.Close();
        }
Пример #2
0
        private IObservable <uint> StartSingle(GamepadConfiguration gamepadConfiguration)
        {
            return(Observable.Create <uint>(observer =>
            {
                var gamepad = new Gamepad(gamepadConfiguration, _vGenWrapper, _hidManager.HidDeviceLoader);
                gamepad.ErrorOccuredEvent += Gamepad_ErrorOccuredEvent;
                if (gamepad.Start())
                {
                    observer.OnNext(gamepadConfiguration.GamepadId);
                }
                else
                {
                    gamepad.Dispose();
                    observer.OnError(GamepadStartException);
                }

                return Disposable.Create(() =>
                {
                    gamepad.Dispose();
                    gamepad.ErrorOccuredEvent -= Gamepad_ErrorOccuredEvent;
                });
            }));
        }