public bool Update(SettingsSet settings) { if (this.IsReloadingNeeded) { this.TryReloadSettings(); } foreach (var settingsSet in this.SettingsSets) { bool bMatched; if (!this.IsGlobalConfig) { // ignore paths bMatched = true; } else { bMatched = false; foreach (var path in settingsSet.Paths) { bMatched = (-1 == path.IndexOfAny(PathSeparators) ? path.Equals(settings.SolutionFileName, StringComparison.CurrentCultureIgnoreCase) : path.Equals(settings.SolutionFilePath, StringComparison.CurrentCultureIgnoreCase)) || (path.Contains("*") || path.Contains("?")) && new Wildcard(path, RegexOptions.IgnoreCase).IsMatch(settings.SolutionFilePath); if (bMatched) { break; } } } if (bMatched) { try { settings.Merge(settingsSet); return(true); } catch (Exception ex) { try { if (CustomizeVSWindowTitle.CurrentPackage.UiSettings.EnableDebugMode) { CustomizeVSWindowTitle.WriteOutput("settings.Merge(settingsSet) exception: " + ex); } } catch { // ignored } return(false); } } } return(false); }
public bool Update(SettingsSet settings) { if (this.IsReloadingNeeded) { this.TryReloadSettings(); } foreach (var settingsSet in this.SettingsSets) { bool bMatched; if (!this.IsGlobalConfig) { // ignore paths bMatched = true; } else { bMatched = false; foreach (var path in settingsSet.Paths) { bMatched = (-1 == path.IndexOfAny(PathSeparators) ? path.Equals(settings.SolutionFileName, StringComparison.CurrentCultureIgnoreCase) : path.Equals(settings.SolutionFilePath, StringComparison.CurrentCultureIgnoreCase)) || (path.Contains("*") || path.Contains("?")) && new Wildcard(path).IsMatch(settings.SolutionFilePath); if (bMatched) { break; } } } if (bMatched) { settings.Merge(settingsSet); return(true); } } return(false); }