public static Theme GetThemeOrDefault(string name) { var theme = themes[name] ?? themes[DefaultThemeName] ?? AllThemesSorted.FirstOrDefault(); Debug.Assert(theme != null); return(theme); }
ITheme GetThemeOrDefault(Guid guid) { Theme theme; if (themes.TryGetValue(guid, out theme)) { return(theme); } if (themes.TryGetValue(DefaultThemeGuid, out theme)) { return(theme); } return(AllThemesSorted.FirstOrDefault()); }