public override void Close() { IOStream.Seek(0, SeekOrigin.Begin); Palettes = null; Textures = null; _disposables.Dispose(); }
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; } }
public static void Disconnect(String reason) { lock (Disposables) { InteractionService.RemoteGameObjects.ClearValue(); Disconnecting?.Invoke(reason); Disposables.Dispose(); } }
private void OnUnloaded(object sender, RoutedEventArgs e) { _disposables.Dispose(); }