Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
 public void SetSoundPreferences(SoundPreferences preferences)
 {
     soundPreferences = preferences;
     SoundsOn = preferences.Enable;
 }