[DllImport(Libraries.AppCommon, EntryPoint = "app_resource_manager_get")]
internal static extern ErrorCode AppResourceManagerGet(ResourceCategory category, string id, out string path);
+ [DllImport(Libraries.Application, EntryPoint = "app_resource_manager_get")]
+ internal static extern ErrorCode LegacyAppResourceManagerGet(ResourceCategory category, string id, out string path);
+
[DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_device_orientation")]
internal static extern ErrorCode AppEventGetDeviceOrientation(IntPtr handle, out DeviceOrientation orientation);
}
Binary
}
+ private static ErrorCode AppResourceManagerGet(Category category, string id, out string path)
+ {
+ ErrorCode err;
+
+ try
+ {
+ err = Interop.AppCommon.AppResourceManagerGet(
+ (Interop.AppCommon.ResourceCategory)category, id, out path);
+ }
+ catch (System.TypeLoadException)
+ {
+ err = Interop.AppCommon.LegacyAppResourceManagerGet(
+ (Interop.AppCommon.ResourceCategory)category, id, out path);
+ }
+
+ return err;
+ }
+
/// <summary>
/// Converts resource ID to path name.
/// </summary>
public static string GetPath(Category category, string id)
{
string path;
- ErrorCode err = Interop.AppCommon.AppResourceManagerGet(
- (Interop.AppCommon.ResourceCategory)category, id, out path);
+ ErrorCode err = AppResourceManagerGet(category, id, out path);
switch (err)
{
public static string TryGetPath(Category category, string id)
{
string path;
- ErrorCode err = Interop.AppCommon.AppResourceManagerGet(
- (Interop.AppCommon.ResourceCategory)category, id, out path);
+ ErrorCode err = AppResourceManagerGet(category, id, out path);
switch (err)
{