public static BackgroundMusicPlayer TryCreateAndPlay() { try { BackgroundMusicPlayer result = new BackgroundMusicPlayer(); result.Play(); return result; } catch (Exception ex) { Log.Error(ex); return null; } }
public static BackgroundMusicPlayer TryCreateAndPlay() { try { BackgroundMusicPlayer result = new BackgroundMusicPlayer(); result.Play(); return(result); } catch (Exception ex) { Log.Error(ex); return(null); } }
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()); }
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()); } }