コード例 #1
0
 public void load(SettingsHelper helper, StyleDatabase db)
 {
     var styleName = helper.GetString(SettingsActiveStyle);
     style = db.styles.FirstOrDefault(s => s.ToString() == styleName);
     applyOnSave = helper.GetBoolean(SettingsFormatOnSave);
 }
コード例 #2
0
        private void CustomStyleListCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.AddedItems.Count == 0 || lastSelectedStyleInfo == selectedStyleInfo ())
                return;

            lastSelectedStyleInfo = selectedStyleInfo();
            clangStylePropertyGrid_PropertyValueChanged_disconnector--;
            curStyle.DisableEvents = true;
            if (!inRename)
            {
                var ev = PropertyChanged;
                if (ev != null)
                    ev(this, new PropertyChangedEventArgs("StyleNameText"));
                curStyle.fromJson(selectedStyleInfo().data);
                updatePreview();
            }
            curStyle.DisableEvents = false; // Lack of RAII makes me cry ~_~
            clangStylePropertyGrid.Update();
            clangStylePropertyGrid_PropertyValueChanged_disconnector++;
        }
コード例 #3
0
 // Set at least to some possible default values
 internal void resolve(StyleDatabase db)
 {
     if (style == null)
         style = db.styles[0];
     if (applyOnSave == null)
         applyOnSave = false;
 }