/// <summary> /// Static cached accessor for <see cref="settingsEntriesForObject"/> /// </summary> /// <param name="key">The key.</param> /// <returns></returns> public static settingsEntriesForObject GetSEO(this Type key) { if (SEOCache.ContainsKey(key)) { return(SEOCache[key]); } settingsEntriesForObject output = new settingsEntriesForObject(key); if (!SEOCache.ContainsKey(key)) { lock (_SEO_Get_lock) { if (!SEOCache.ContainsKey(key)) { SEOCache.Add(key, output); } } } return(output); }
/// <summary> /// Builds member info group dictionary /// </summary> /// <param name="objectInfo">The object information.</param> /// <returns></returns> public static settingsMemberInfoGroupDictionary GetMemberInfoGroupDictionary(this settingsEntriesForObject objectInfo) { List <String> groups = new List <string>(); settingsMemberInfoGroupDictionary output = new settingsMemberInfoGroupDictionary(); if (objectInfo.CategoryByPriority.Any()) { groups = objectInfo.CategoryByPriority; } else { foreach (var pp in objectInfo.spes) { if (!groups.Contains(pp.Value.categoryName)) { groups.Add(pp.Value.categoryName); } } } foreach (String g in groups) { output.Add(g, new settingsMemberInfoGroup(g)); } foreach (var pp in objectInfo.spes) { if (!pp.Value.categoryName.isNullOrEmpty()) { if (groups.Contains(pp.Value.categoryName)) { output[pp.Value.categoryName].Add(pp.Value); } } } return(output); }