diff options
author | Kangho Hur <kangho.hur@samsung.com> | 2016-12-16 11:00:07 +0900 |
---|---|---|
committer | Kangho Hur <kangho.hur@samsung.com> | 2017-07-10 11:11:14 +0900 |
commit | 79bf87f2bc00d823cf8b25ed7d0d3650cf819b4c (patch) | |
tree | 99d3412413a92c057cb8ad8429ddb0c7d4cb8c14 /Xamarin.Forms.Platform.Tizen/ResourcePath.cs | |
parent | b7297c8ac01d6ce2d5f038d3df8f4bc9e74a8162 (diff) | |
download | xamarin-forms-79bf87f2bc00d823cf8b25ed7d0d3650cf819b4c.tar.gz xamarin-forms-79bf87f2bc00d823cf8b25ed7d0d3650cf819b4c.tar.bz2 xamarin-forms-79bf87f2bc00d823cf8b25ed7d0d3650cf819b4c.zip |
Add Tizen backend renderer
- Xamarin.Forms.Platform.Tizen has been added
- Xamarin.Forms.Maps.Tizen has been added
- RPM build spec has been added
Change-Id: I0021e0f040d97345affc87512ee0f6ce437f4e6d
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen/ResourcePath.cs')
-rw-r--r-- | Xamarin.Forms.Platform.Tizen/ResourcePath.cs | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/ResourcePath.cs b/Xamarin.Forms.Platform.Tizen/ResourcePath.cs new file mode 100644 index 00000000..d2387793 --- /dev/null +++ b/Xamarin.Forms.Platform.Tizen/ResourcePath.cs @@ -0,0 +1,44 @@ +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; + } + } +} |