WindowsRuntimeResourceManagerBase.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. // See the LICENSE file in the project root for more information.
  4. using System.Globalization;
  5. namespace Internal.Resources
  6. {
  7. // This is implemented in System.Runtime.WindowsRuntime as System.Resources.WindowsRuntimeResourceManager,
  8. // allowing us to ask for a WinRT-specific ResourceManager.
  9. public abstract class WindowsRuntimeResourceManagerBase
  10. {
  11. public abstract bool Initialize(string libpath, string reswFilename, out PRIExceptionInfo? exceptionInfo);
  12. public abstract string GetString(string stringName, string? startingCulture, string? neutralResourcesCulture);
  13. public abstract CultureInfo? GlobalResourceContextBestFitCultureInfo
  14. {
  15. get;
  16. }
  17. public abstract bool SetGlobalResourceContextDefaultCulture(CultureInfo ci);
  18. /// <summary>
  19. /// Check whether CultureData exists for specified cultureName
  20. /// This API is used for WindowsRuntimeResourceManager in System.Runtime.WindowsRuntime
  21. /// </summary>
  22. public static bool IsValidCulture(string? cultureName)
  23. {
  24. return CultureData.GetCultureData(cultureName, /* useUserOverride */ true) != null;
  25. }
  26. }
  27. }