private void SetSettingsModels(CompilerSettingsModel compilerModel, FormatSettingsModel formatModel, TidySettingsModel tidyModel, GeneralSettingsModel generalModel) { settingsProvider.SetCompilerSettingsModel(compilerModel); settingsProvider.SetFormatSettingsModel(formatModel); settingsProvider.SetTidySettingsModel(tidyModel); settingsProvider.SetGeneralSettingsModel(generalModel); }
private void BeforeSaveClangFormat(Document aDocument) { FormatSettingsModel formatSettings = settingsProvider.GetFormatSettingsModel(); TidySettingsModel tidySettings = settingsProvider.GetTidySettingsModel(); if (currentCommand == CommandIds.kTidyFixId && running && tidySettings.FormatAfterTidy && formatSettings.FormatOnSave) { mFormatAfterTidyFlag = true; return; } if (false == formatSettings.FormatOnSave) { return; } if (false == Vsix.IsDocumentDirty(aDocument) && false == mFormatAfterTidyFlag) { return; } if (false == FileHasExtension(aDocument.FullName, formatSettings.FileExtensions)) { return; } if (true == SkipFile(aDocument.FullName, formatSettings.FilesToIgnore)) { return; } FormatCommand.Instance.FormatOnSave(aDocument); }
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 MapClangFormatOptionsToSettings(ClangFormatOptions clangFormat) { FormatSettingsModel formatSettingsModel = new FormatSettingsModel(); formatSettingsModel.FileExtensions = clangFormat.FileExtensions; formatSettingsModel.FilesToIgnore = clangFormat.SkipFiles; formatSettingsModel.AssumeFilename = clangFormat.AssumeFilename; formatSettingsModel.CustomExecutable = clangFormat.ClangFormatPath.Value; formatSettingsModel.Style = clangFormat.Style; formatSettingsModel.FallbackStyle = clangFormat.FallbackStyle; formatSettingsModel.FormatOnSave = clangFormat.EnableFormatOnSave; settingsProvider.SetFormatSettingsModel(formatSettingsModel); }
private void MapClangFormatOptionsToSettings(ClangFormatOptions clangFormat) { var formatSettingsModel = new FormatSettingsModel { FileExtensions = clangFormat.FileExtensions, FilesToIgnore = clangFormat.SkipFiles, AssumeFilename = clangFormat.AssumeFilename, CustomExecutable = clangFormat.ClangFormatPath.Value, Style = clangFormat.Style, FallbackStyle = clangFormat.FallbackStyle, FormatOnSave = clangFormat.EnableFormatOnSave }; SettingsProvider.FormatSettingsModel = formatSettingsModel; }
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; }
public FormatSettingsViewModel() { formatModel = SettingsProvider.FormatSettingsModel; }
public FormatSettingsViewModel() { var settingsProvider = new SettingsProvider(); formatModel = settingsProvider.GetFormatSettingsModel(); }
public void SetFormatSettingsModel(FormatSettingsModel model) { formatSettingsModel = model; }
public TidyConfigFile() { compilerSettingsModel = settingsProvider.GetCompilerSettingsModel(); tidySettingsModel = settingsProvider.GetTidySettingsModel(); formatSettingsModel = settingsProvider.GetFormatSettingsModel(); }