コード例 #1
0
 public static BackgroundMusicPlayer TryCreateAndPlay()
 {
     try
     {
         BackgroundMusicPlayer result = new BackgroundMusicPlayer();
         result.Play();
         return result;
     }
     catch (Exception ex)
     {
         Log.Error(ex);
         return null;
     }
 }
コード例 #2
0
 public static BackgroundMusicPlayer TryCreateAndPlay()
 {
     try
     {
         BackgroundMusicPlayer result = new BackgroundMusicPlayer();
         result.Play();
         return(result);
     }
     catch (Exception ex)
     {
         Log.Error(ex);
         return(null);
     }
 }
コード例 #3
0
        public MainWindow()
        {
            InitializeComponent();
            Unloaded += OnUnloaded;
            MouseDown += OnMouseDown;

            _player = _disposables.Add(BackgroundMusicPlayer.TryCreateAndPlay());
            PlayButton.GameSettings = GameSettings;
            PlayButton.MusicPlayer = _player;

            LocalizatorEnvironmentInfo info = InteractionService.LocalizatorEnvironment.Provide();
            if (!info.PlayMusic)
                OnMusicButtonClick(MusicButton, new RoutedEventArgs());
            if (!info.ExitAfterRunGame)
                OnSwitchButtonClick(SwitchButton, new RoutedEventArgs());
        }
コード例 #4
0
ファイル: MainWindow.xaml.cs プロジェクト: pinguallyj/Pulse
        public MainWindow()
        {
            InitializeComponent();
            Unloaded  += OnUnloaded;
            MouseDown += OnMouseDown;

            _player = _disposables.Add(BackgroundMusicPlayer.TryCreateAndPlay());
            PlayButton.GameSettings = GameSettings;
            PlayButton.MusicPlayer  = _player;

            LocalizatorEnvironmentInfo info = InteractionService.LocalizatorEnvironment.Provide();

            if (!info.PlayMusic)
            {
                OnMusicButtonClick(MusicButton, new RoutedEventArgs());
            }
            if (!info.ExitAfterRunGame)
            {
                OnSwitchButtonClick(SwitchButton, new RoutedEventArgs());
            }
        }