private void AddButton_Click(object sender, RoutedEventArgs e)
 {
     var llvmStyle = new PredefinedStyleInfo (ClangFormat.StyleId.LLVM);
     styleDatabase.addStyle(new CustomStyleInfo(styleDatabase.newCustomName (), llvmStyle.getData(null)));
 }
Esempio n. 2
0
        private void loadSettings()
        {
            int index = 0;
            using (settingsHelper.folderScope (SettingsFolderCustomStyleList))
            {
                 while (true)
                    {
                      string styleStr = settingsHelper.GetString(index.ToString());
                      if (styleStr == null)
                          break;
                      styles.Add (JsonConvert.DeserializeObject<CustomStyleInfo>(styleStr));
                      ++index;
                    }
            }

            if (index == 0)
            {
                var llvmStyle = new PredefinedStyleInfo(ClangFormat.StyleId.LLVM);
                styles.Add(new CustomStyleInfo("Custom", llvmStyle.getData(null)));
                saveSettings();
            }

            settings[FormatterSettingsScope.global].load(settingsHelper, this);

            settings[FormatterSettingsScope.global].resolve(this);
        }