private void MapOldSettings()
        {
            ClangOptions clangOptions = LoadOldSettingsFromFile(new ClangOptions(), GeneralConfigurationFileName);
              MapClangOptionsToSettings(clangOptions);

              ClangFormatOptions clangFormatOptions = LoadOldSettingsFromFile(new ClangFormatOptions(), FormatConfigurationFileName);
              MapClangFormatOptionsToSettings(clangFormatOptions);

              ClangTidyOptions clangTidyOptions = LoadOldSettingsFromFile(new ClangTidyOptions(), TidyOptionsConfigurationFileName);
              MapClangTidyOptionsToSettings(clangTidyOptions);

              ClangTidyPredefinedChecksOptions clangTidyPredefinedChecksOptions = LoadOldSettingsFromFile(new ClangTidyPredefinedChecksOptions(), TidyPredefinedChecksConfigurationFileName);
              MapTidyPredefinedChecksToTidyettings(clangTidyPredefinedChecksOptions);
        }
예제 #2
0
        private void MapTidyPredefinedChecksToTidyettings(ClangTidyPredefinedChecksOptions clangTidyPredefinedChecksOptions)
        {
            PropertyInfo[] properties = typeof(ClangTidyPredefinedChecksOptions).GetProperties();

            foreach (PropertyInfo propertyInfo in properties)
            {
                bool isChecked = (bool)propertyInfo.GetValue(new ClangTidyPredefinedChecksOptions(), null);

                if (isChecked)
                {
                    SettingsViewModelProvider.TidySettingsViewModel.TidyModel.PredefinedChecks += string.Concat(FormatTidyCheckName(propertyInfo.Name), ";");
                }
            }
        }
예제 #3
0
        private void MapTidyPredefinedChecksToTidyettings(ClangTidyPredefinedChecksOptions clangTidyPredefinedChecksOptions)
        {
            PropertyInfo[]    properties        = typeof(ClangTidyPredefinedChecksOptions).GetProperties();
            TidySettingsModel tidySettingsModel = settingsProvider.GetTidySettingsModel();

            foreach (PropertyInfo propertyInfo in properties)
            {
                bool isChecked = (bool)propertyInfo.GetValue(clangTidyPredefinedChecksOptions, null);

                if (isChecked)
                {
                    tidySettingsModel.PredefinedChecks += string.Concat(FormatTidyCheckName(propertyInfo.Name), ";");
                }
            }

            settingsProvider.SetTidySettingsModel(tidySettingsModel);
        }