WindowsRuntimeResourceManagerBase.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  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;
  5. using System.Globalization;
  6. namespace Internal.Resources
  7. {
  8. // This is implemented in System.Runtime.WindowsRuntime as System.Resources.WindowsRuntimeResourceManager,
  9. // allowing us to ask for a WinRT-specific ResourceManager.
  10. public abstract class WindowsRuntimeResourceManagerBase
  11. {
  12. public abstract bool Initialize(string libpath, string reswFilename, out PRIExceptionInfo exceptionInfo);
  13. public abstract string GetString(string stringName, string startingCulture, string neutralResourcesCulture);
  14. public abstract CultureInfo GlobalResourceContextBestFitCultureInfo
  15. {
  16. get;
  17. }
  18. public abstract bool SetGlobalResourceContextDefaultCulture(CultureInfo ci);
  19. /// <summary>
  20. /// Check whether CultureData exists for specified cultureName
  21. /// This API is used for WindowsRuntimeResourceManager in System.Runtime.WindowsRuntime
  22. /// </summary>
  23. public static bool IsValidCulture(string cultureName)
  24. {
  25. return CultureData.GetCultureData(cultureName, /* useUserOverride */ true) != null;
  26. }
  27. }
  28. }