public WinFormsSoundService() { try { var soundsDir = System.IO.Path.Combine(GetExecutionDirectory(), "Sounds"); _tallySoundPlayer = new SoundPlayer(new FileStream(soundsDir + "\\tally.wav", System.IO.FileMode.Open)); _pageChangedSoundPlayer = new SoundPlayer(new FileStream(soundsDir + "\\pageChange.wav", FileMode.Open)); _measureSoundPlayer = new SoundPlayer(new FileStream(soundsDir + "\\measure.wav", FileMode.Open)); _insuranceSoundPlayer = new SoundPlayer(new FileStream(soundsDir + "\\insurance.wav", FileMode.Open)); } catch { } }
protected virtual void Dispose(bool disposing) { if (disposing) { #if NetCF if (_pageChangedSoundPlayer != null) { _pageChangedSoundPlayer.Dispose(); _pageChangedSoundPlayer = null; } if (_tallySoundPlayer != null) { _tallySoundPlayer.Dispose(); _tallySoundPlayer = null; } #endif } }