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

                LlvmSettingsModel llvmModel;
                if (models.Count >= MinJsonElements)
                {
                    llvmModel = JsonConvert.DeserializeObject <LlvmSettingsModel>(models[4].ToString());
                }
                else
                {
                    llvmModel = new LlvmSettingsModel();
                }

                SetSettingsModels(compilerModel, formatModel, tidyModel, generalModel, llvmModel);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message, "Cannot Load Clang Power Tools Settings", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #2
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();
        }
Example #3
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;
 }