X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FTizen.Applications.Common%2FTizen.Applications%2FResourceManager.cs;h=d300c57b1a62f8ba6294b3ae3cb324f998055fcf;hb=refs%2Ftags%2Fpreview1-00234;hp=c20840a5977ed543ffdfaa7dd3c176a4fba549fb;hpb=2d207cfaf087114d8ff35cbae7f6ba1a9fd95265;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git
diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ResourceManager.cs b/src/Tizen.Applications.Common/Tizen.Applications/ResourceManager.cs
index c20840a..d300c57b 100755
--- a/src/Tizen.Applications.Common/Tizen.Applications/ResourceManager.cs
+++ b/src/Tizen.Applications.Common/Tizen.Applications/ResourceManager.cs
@@ -15,17 +15,18 @@
*/
using System;
+using System.IO;
using Tizen.Internals.Errors;
namespace Tizen.Applications
{
///
- /// Class for getting resource path.
+ /// The class for getting the resource path.
///
public static class ResourceManager
{
///
- /// Enumeration for Resource category.
+ /// Enumeration for the resource category.
///
public enum Category : int
{
@@ -69,12 +70,12 @@ namespace Tizen.Applications
}
///
- /// Converts resource ID to path name.
+ /// Converts resource ID to the path name.
///
- /// Category to search
- /// ID to search
- /// Found resource path
- /// Thrown in case of failed conditions
+ /// Category to search.
+ /// ID to search.
+ /// Found resource path.
+ /// Thrown in case of failed conditions.
public static string GetPath(Category category, string id)
{
string path;
@@ -96,17 +97,31 @@ namespace Tizen.Applications
}
///
- /// Converts resource ID to path name.
+ /// Converts resource ID to the path name.
///
- /// Category to search
- /// ID to search
- /// Found resource path or null when the resource doesn't exist
- /// Thrown in case of failed conditions
+ /// Category to search.
+ /// ID to search.
+ /// Found resource path or null when the resource doesn't exist.
+ /// Thrown in case of failed conditions.
public static string TryGetPath(Category category, string id)
{
string path;
- ErrorCode err = AppResourceManagerGet(category, id, out path);
+ ErrorCode err;
+ string res;
+
+ if (Application.Current != null)
+ {
+ res = Application.Current.DirectoryInfo.Resource + "res.xml";
+ }
+ else
+ {
+ res = Interop.AppCommon.AppGetResourcePath() + "res.xml";
+ }
+
+ if (!File.Exists(res))
+ return null;
+ err = AppResourceManagerGet(category, id, out path);
switch (err)
{
case ErrorCode.InvalidParameter: