X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FTizen.Applications.Common%2FTizen.Applications%2FDirectoryInfo.cs;h=d722df7936f0981b4c8d847b8c86bd93159cd9db;hb=c88909880dbccc0205cf13c02360d9174ae945f1;hp=cceaba4126bfba986633f795c5bf756b034fb6bf;hpb=71e2d994fb5a6d7a2b7fcfea5718d60b53f0f035;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git diff --git a/src/Tizen.Applications.Common/Tizen.Applications/DirectoryInfo.cs b/src/Tizen.Applications.Common/Tizen.Applications/DirectoryInfo.cs index cceaba4..d722df7 100644 --- a/src/Tizen.Applications.Common/Tizen.Applications/DirectoryInfo.cs +++ b/src/Tizen.Applications.Common/Tizen.Applications/DirectoryInfo.cs @@ -14,6 +14,10 @@ * limitations under the License. */ +using System; +using System.ComponentModel; +using System.IO; + namespace Tizen.Applications { /// @@ -180,5 +184,75 @@ namespace Tizen.Applications return _expansionPackageResourcePath; } } + + /// + /// Gets the absolute path to the application's resource control directory, which is used to share the allowed resources of the resource packages. + /// + /// The resource type defined in the resource package + /// The absolute path to the application's resource control directory, which is used to share the allowed resources of the resource packages. + /// Thrown in case of an invalid parameter. + /// Thrown in case of out of memory. + /// Thrown in case of nonexistence of resource. + /// Thrown in case of any internal error. + /// 10 + [EditorBrowsable(EditorBrowsableState.Never)] + public string GetResourceControlAllowedResource(string resourceType) + { + string path = string.Empty; + Interop.AppCommon.AppCommonErrorCode err = Interop.AppCommon.AppGetResControlAllowedResourcePath(resourceType, out path); + if (err != Interop.AppCommon.AppCommonErrorCode.None) + { + switch (err) + { + case Interop.AppCommon.AppCommonErrorCode.InvalidParameter: + throw new ArgumentException("Invalid Arguments"); + case Interop.AppCommon.AppCommonErrorCode.OutOfMemory: + throw new OutOfMemoryException("Out of memory"); + case Interop.AppCommon.AppCommonErrorCode.InvalidContext: + throw new InvalidOperationException("Invalid app context"); + case Interop.AppCommon.AppCommonErrorCode.PermissionDenied: + throw new DirectoryNotFoundException(String.Format("Allowed Resource about {0} is not Found", resourceType)); + default: + throw new InvalidOperationException("Invalid Operation"); + } + } + + return path; + } + + /// + /// Gets the absolute path to the application's resource control directory, which is used to share the global resources of the resource packages. + /// + /// The resource type defined in the resource package + /// The absolute path to the application's resource control directory, which is used to share the global resources of the resource packages. + /// Thrown in case of an invalid parameter. + /// Thrown in case of out of memory. + /// Thrown in case of nonexistence of resource. + /// Thrown in case of any internal error. + /// 10 + [EditorBrowsable(EditorBrowsableState.Never)] + public string GetResourceControlGlobalResource(string resourceType) + { + string path = string.Empty; + Interop.AppCommon.AppCommonErrorCode err = Interop.AppCommon.AppGetResControlGlobalResourcePath(resourceType, out path); + if (err != Interop.AppCommon.AppCommonErrorCode.None) + { + switch (err) + { + case Interop.AppCommon.AppCommonErrorCode.InvalidParameter: + throw new ArgumentException("Invalid Arguments"); + case Interop.AppCommon.AppCommonErrorCode.OutOfMemory: + throw new OutOfMemoryException("Out of memory"); + case Interop.AppCommon.AppCommonErrorCode.InvalidContext: + throw new InvalidOperationException("Invalid app context"); + case Interop.AppCommon.AppCommonErrorCode.PermissionDenied: + throw new DirectoryNotFoundException(String.Format("Allowed Resource about {0} is not Found", resourceType)); + default: + throw new InvalidOperationException("Invalid Operation"); + } + } + + return path; + } } }