Esempio n. 1
0
        /// <summary>
        /// Constructor for the DisplayPresetCollection singleton. Initializes the
        /// collection of presets with presets saved in the configuration file.
        /// </summary>
        private DisplayPresetCollection()
        {
            mDisplayPresetDictionary = new Dictionary <string, DisplayPreset>(StringComparer.CurrentCultureIgnoreCase);

            // RAII baby, load it up
            List <DisplayPreset> displayPresets = DisplayPersistence.LoadPresets();

            if (displayPresets != null)
            {
                foreach (DisplayPreset preset in displayPresets)
                {
                    mDisplayPresetDictionary.Add(preset.Name, preset);
                }
            }

            DisplayPresetCollectionChanged += OnDisplayPresetCollectionChanged;
        }
Esempio n. 2
0
 /// <summary>
 /// Writes current collection of display presets to disk if changes have been made.
 /// </summary>
 private void PersistDisplayPresets()
 {
     DisplayPersistence.WritePresets(this.GetPresets());
 }