From 74fadd98edc7f37d3af366b0a5c7bb2a42007eb6 Mon Sep 17 00:00:00 2001 From: Luqun Lou Date: Fri, 29 Jun 2018 09:24:45 -0700 Subject: [PATCH] Add public implementation CultureDataSupport (dotnet/coreclr#18691) Commit migrated from https://github.com/dotnet/coreclr/commit/7acc7194a25cd3965c310cc94479f09f7f80714c --- .../src/System.Private.CoreLib/System.Private.CoreLib.csproj | 2 +- .../src/Internal/Resources/WindowsRuntimeResourceManagerBase.cs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj index dbf4545..1d522cb 100644 --- a/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -303,8 +303,8 @@ - + diff --git a/src/coreclr/src/System.Private.CoreLib/src/Internal/Resources/WindowsRuntimeResourceManagerBase.cs b/src/coreclr/src/System.Private.CoreLib/src/Internal/Resources/WindowsRuntimeResourceManagerBase.cs index ac18b20..6594ae6 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/Internal/Resources/WindowsRuntimeResourceManagerBase.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/Internal/Resources/WindowsRuntimeResourceManagerBase.cs @@ -21,5 +21,14 @@ namespace Internal.Resources } public abstract bool SetGlobalResourceContextDefaultCulture(CultureInfo ci); + + /// + /// Check whether CultureData exists for specified cultureName + /// This API is used for WindowsRuntimeResourceManager in System.Runtime.WindowsRuntime + /// + public static bool IsValidCulture(string cultureName) + { + return CultureData.GetCultureData(cultureName, /* useUserOverride */ true) != null; + } } } -- 2.7.4