Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 7acc719

Browse files
authored
Add public implementation CultureDataSupport (#18691)
1 parent d96ac2c commit 7acc719

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/System.Private.CoreLib/System.Private.CoreLib.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,8 @@
303303
<Compile Include="$(BclSourcesRoot)\Internal\Console.cs" />
304304
<Compile Condition="'$(FeatureCominterop)' == 'true'" Include="$(BclSourcesRoot)\Internal\Threading\Tasks\AsyncCausalitySupport.cs" />
305305
<Compile Condition="'$(FeatureCominterop)' == 'true'" Include="$(BclSourcesRoot)\Internal\Runtime\InteropServices\WindowsRuntime\ExceptionSupport.cs" />
306-
<Compile Condition="'$(FeatureAppX)' == 'true'" Include="$(BclSourcesRoot)\Internal\Resources\WindowsRuntimeResourceManagerBase.cs" />
307306
<Compile Condition="'$(FeatureAppX)' == 'true'" Include="$(BclSourcesRoot)\Internal\Resources\PRIExceptionInfo.cs" />
307+
<Compile Condition="'$(FeatureAppX)' == 'true'" Include="$(BclSourcesRoot)\Internal\Resources\WindowsRuntimeResourceManagerBase.cs" />
308308
</ItemGroup>
309309
<ItemGroup>
310310
<Compile Include="$(BclSourcesRoot)\System\Reflection\Assembly.CoreCLR.cs" />

src/System.Private.CoreLib/src/Internal/Resources/WindowsRuntimeResourceManagerBase.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,14 @@ public abstract CultureInfo GlobalResourceContextBestFitCultureInfo
2121
}
2222

2323
public abstract bool SetGlobalResourceContextDefaultCulture(CultureInfo ci);
24+
25+
/// <summary>
26+
/// Check whether CultureData exists for specified cultureName
27+
/// This API is used for WindowsRuntimeResourceManager in System.Runtime.WindowsRuntime
28+
/// </summary>
29+
public static bool IsValidCulture(string cultureName)
30+
{
31+
return CultureData.GetCultureData(cultureName, /* useUserOverride */ true) != null;
32+
}
2433
}
2534
}

0 commit comments

Comments
 (0)