diff --git a/BeWoPlanerMobil/BeWoPlanerMobil.csproj b/BeWoPlanerMobil/BeWoPlanerMobil.csproj index 8e8e6cb2f..1da3ceb41 100644 --- a/BeWoPlanerMobil/BeWoPlanerMobil.csproj +++ b/BeWoPlanerMobil/BeWoPlanerMobil.csproj @@ -78,6 +78,7 @@ + @@ -95,6 +96,8 @@ + + ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll diff --git a/BeWoPlanerMobil/Util/MobileUserSettingsUtils.cs b/BeWoPlanerMobil/Util/MobileUserSettingsUtils.cs index 4085589db..9d2982253 100644 --- a/BeWoPlanerMobil/Util/MobileUserSettingsUtils.cs +++ b/BeWoPlanerMobil/Util/MobileUserSettingsUtils.cs @@ -13,17 +13,18 @@ namespace BeWoPlanerMobil.Util /// Key des Wertes /// Standardwert, falls die Konversion fehlschlägt /// - public static T GetSettingValueAsEnum(string settings, string key, T defaultResult) where T : struct, Enum + public static T GetSettingValueAsEnum(string settings, string key, T defaultResult) { - var cSharpVersion = typeof(string).Assembly.ImageRuntimeVersion; - var stringValue = UserSettingsUtils.GetSettingValue(settings, key); - var didParse = Enum.TryParse(stringValue, out T result); - - var isDefined = Enum.IsDefined(typeof(T), result); - - return didParse && isDefined ? result : defaultResult; + try + { + return (T)Enum.Parse(typeof(T), stringValue); + } + catch(Exception) + { + return defaultResult; + } } } } \ No newline at end of file diff --git a/BeWoPlanerMobil/Web.config b/BeWoPlanerMobil/Web.config index b97d85fce..8b98748ba 100644 --- a/BeWoPlanerMobil/Web.config +++ b/BeWoPlanerMobil/Web.config @@ -1,17 +1,17 @@ - + -
+
- + - + @@ -28,110 +28,111 @@ --> - - - - - - - - - + + + + + + + + + - - + + - + - + - - - - - - - + + + + + + + + - - + + - - - + + + - - - - + + + + - - - + + + - - + + - - + + - + - - + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - + - + - - - - - - - + + + + + + + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + \ No newline at end of file