using System.IO; #if NET45 using System.Reflection; #endif using AppFW = Tizen.Applications; namespace Xamarin.Forms.Platform.Tizen { internal static class ResourcePath { public static string GetPath(string res) { if (Path.IsPathRooted(res)) { return res; } AppFW.Application app = AppFW.Application.Current; if (app != null) { string resPath = app.DirectoryInfo.Resource + res; if (File.Exists(resPath)) { return resPath; } } #if NET45 string exedir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); // ind resource in "exepath/../res/" { string resPath = exedir + "/../res/" + res; if (File.Exists(resPath)) { return resPath; } } #endif return res; } } }