private void SetSettingsModels(CompilerSettingsModel compilerModel, FormatSettingsModel formatModel, TidySettingsModel tidyModel, GeneralSettingsModel generalModel)
 {
     settingsProvider.SetCompilerSettingsModel(compilerModel);
     settingsProvider.SetFormatSettingsModel(formatModel);
     settingsProvider.SetTidySettingsModel(tidyModel);
     settingsProvider.SetGeneralSettingsModel(generalModel);
 }
Example #2
0
 private void SetSettingsModels(CompilerSettingsModel compilerModel, FormatSettingsModel formatModel,
                                TidySettingsModel tidyModel, GeneralSettingsModel generalModel, LlvmSettingsModel llvmModel)
 {
     SettingsProvider.CompilerSettingsModel = compilerModel;
     SettingsProvider.FormatSettingsModel   = formatModel;
     SettingsProvider.TidySettingsModel     = tidyModel;
     SettingsProvider.GeneralSettingsModel  = generalModel;
     SettingsProvider.LlvmSettingsModel     = llvmModel;
 }
        private void MapClangOptionsToSettings(ClangOptions clangOptions)
        {
            CompilerSettingsModel compilerSettingsModel = new CompilerSettingsModel();
            GeneralSettingsModel  generalSettingsModel  = new GeneralSettingsModel();

            compilerSettingsModel.CompileFlags     = clangOptions.ClangFlagsCollection;
            compilerSettingsModel.FilesToIgnore    = clangOptions.FilesToIgnore;
            compilerSettingsModel.ProjectsToIgnore = clangOptions.ProjectsToIgnore;
            compilerSettingsModel.WarningsAsErrors = clangOptions.TreatWarningsAsErrors;
            compilerSettingsModel.ContinueOnError  = clangOptions.Continue;
            compilerSettingsModel.ClangAfterMSVC   = clangOptions.ClangCompileAfterVsCompile;
            compilerSettingsModel.VerboseMode      = clangOptions.VerboseMode;
            generalSettingsModel.Version           = clangOptions.Version;

            settingsProvider.SetCompilerSettingsModel(compilerSettingsModel);
            settingsProvider.SetGeneralSettingsModel(generalSettingsModel);
        }
        private void BeforeExecuteClangCompile(string aGuid, int aId)
        {
            CompilerSettingsModel compilerSettings = settingsProvider.GetCompilerSettingsModel();

            if (compilerSettings.ClangAfterMSVC == false)
            {
                return;
            }

            string commandName = GetCommandName(aGuid, aId);

            if (0 != string.Compare("Build.Compile", commandName))
            {
                return;
            }

            CompileCommand.Instance.VsCompileFlag = true;
        }
Example #5
0
        private void IntitializeView()
        {
            foreach (var version in LlvmVersions.Versions)
            {
                var llvmModel = new LlvmSettingsModel()
                {
                    Version     = version,
                    IsInstalled = llvmController.IsVersionExeOnDisk(version, uninstall),
                };

                if (llvmModel.IsInstalled)
                {
                    InstalledLlvms.Add(llvmModel.Version);
                }

                llvms.Add(llvmModel);
            }

            compilerModel = settingsProvider.GetCompilerSettingsModel();
            ResetVersionUsedIfRequired();
        }
        private void DeserializeSettings(string path)
        {
            using (StreamReader sw = new StreamReader(path))
            {
                string         json       = sw.ReadToEnd();
                JsonSerializer serializer = new JsonSerializer();

                try
                {
                    List <object>         models        = JsonConvert.DeserializeObject <List <object> >(json);
                    CompilerSettingsModel compilerModel = JsonConvert.DeserializeObject <CompilerSettingsModel>(models[0].ToString());
                    FormatSettingsModel   formatModel   = JsonConvert.DeserializeObject <FormatSettingsModel>(models[1].ToString());
                    TidySettingsModel     tidyModel     = JsonConvert.DeserializeObject <TidySettingsModel>(models[2].ToString());
                    GeneralSettingsModel  generalModel  = JsonConvert.DeserializeObject <GeneralSettingsModel>(models[3].ToString());

                    SetSettingsModels(compilerModel, formatModel, tidyModel, generalModel);
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.Message, "Cannot Load Clang Power Tools Settings", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
 public TidyConfigFile()
 {
     compilerSettingsModel = SettingsProvider.CompilerSettingsModel;
     tidySettingsModel     = SettingsProvider.TidySettingsModel;
     formatSettingsModel   = SettingsProvider.FormatSettingsModel;
 }
Example #8
0
 public void SetCompilerSettingsModel(CompilerSettingsModel model)
 {
     compilerSettingsModel = model;
 }
        public CompilerSettingsViewModel()
        {
            var settingsProvider = new SettingsProvider();

            compilerModel = settingsProvider.GetCompilerSettingsModel();
        }
 public CompilerSettingsViewModel()
 {
     compilerModel = SettingsProvider.CompilerSettingsModel;
 }
Example #11
0
 public TidyConfigFile()
 {
     compilerSettingsModel = settingsProvider.GetCompilerSettingsModel();
     tidySettingsModel     = settingsProvider.GetTidySettingsModel();
     formatSettingsModel   = settingsProvider.GetFormatSettingsModel();
 }