public SoundPreferences Load() { SoundPreferences preferences = new SoundPreferences(); try { if (File.Exists(CONFIG)) { log.Debug("Loading SoundPreferences..."); Stream stream = File.Open(CONFIG, FileMode.Open); BinaryFormatter bformatter = new BinaryFormatter(); preferences = (SoundPreferences)bformatter.Deserialize(stream); stream.Close(); log.Debug("SoundPreferences were loaded"); } } catch (Exception ex) { log.Error("Failed to load SoundPreferences:", ex); } return(preferences); }
public SoundPreferences Load() { SoundPreferences preferences = new SoundPreferences(); try { if (File.Exists(CONFIG)) { log.Debug("Loading SoundPreferences..."); Stream stream = File.Open(CONFIG, FileMode.Open); BinaryFormatter bformatter = new BinaryFormatter(); preferences = (SoundPreferences)bformatter.Deserialize(stream); stream.Close(); log.Debug("SoundPreferences were loaded"); } } catch (Exception ex) { log.Error("Failed to load SoundPreferences:", ex); } return preferences; }
public void SetSoundPreferences(SoundPreferences preferences) { soundPreferences = preferences; SoundsOn = preferences.Enable; }