Beispiel #1
0
 /// <summary>
 /// Reset all options to default (in GlobalOptions)
 /// </summary>
 public void Reset()
 {
     foreach (CheckBox box in _allOptions)
     {
         LabeledOptionDefinition definition = box.Tag as LabeledOptionDefinition;
         if (definition != null)
         {
             box.IsChecked = _globalOptions.GetOptionValue <bool>(definition.Name);
         }
     }
 }
Beispiel #2
0
        /// <summary>
        /// Save the options that are selected into the global options
        /// </summary>
        public void Apply()
        {
            foreach (CheckBox box in _allOptions)
            {
                LabeledOptionDefinition definition = box.Tag as LabeledOptionDefinition;
                if (definition != null)
                {
                    bool oldValue = _globalOptions.GetOptionValue <bool>(definition.Name);
                    if (box.IsChecked != oldValue)
                    {
                        _globalOptions.SetOptionValue(definition.Name, box.IsChecked);

                        this.SaveOption(definition.Name);
                    }
                }
            }
        }