Exemple #1
0
 public override void Close()
 {
     IOStream.Seek(0, SeekOrigin.Begin);
     Palettes = null;
     Textures = null;
     _disposables.Dispose();
 }
Exemple #2
0
 public BackgroundMusicPlayer()
 {
     try
     {
         _stream          = _disposables.Add(Assembly.GetExecutingAssembly().GetManifestResourceStream(FileName));
         _audioFileReader = _disposables.Add(new Mp3FileReader(_stream, CreateMp3Decompressor));
         _waveOutDevice   = _disposables.Add(new WaveOut());
         _waveOutDevice.Init(_audioFileReader);
         _waveOutDevice.PlaybackStopped += OnPlaybackStopped;
     }
     catch
     {
         _disposables.Dispose();
         throw;
     }
 }
Exemple #3
0
 public static void Disconnect(String reason)
 {
     lock (Disposables)
     {
         InteractionService.RemoteGameObjects.ClearValue();
         Disconnecting?.Invoke(reason);
         Disposables.Dispose();
     }
 }
Exemple #4
0
 private void OnUnloaded(object sender, RoutedEventArgs e)
 {
     _disposables.Dispose();
 }