Binary
}
+ internal enum AppCommonErrorCode
+ {
+ None = Tizen.Internals.Errors.ErrorCode.None,
+ InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
+ OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory,
+ InvalidContext = -0x01100000 | 0x01,
+ NoSuchFile = Tizen.Internals.Errors.ErrorCode.NoSuchFile,
+ PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied,
+ }
+
[DllImport(Libraries.AppCommon, EntryPoint = "app_get_id")]
internal static extern ErrorCode AppGetId(out string appId);
[DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_suspended_state")]
internal static extern ErrorCode AppEventGetSuspendedState(IntPtr handle, out SuspendedState state);
+
+ [DllImport(Libraries.AppCommon, EntryPoint = "app_get_res_control_allowed_resource_path")]
+ internal static extern AppCommonErrorCode AppGetResControlAllowedResourcePath(string applicationId, out string path);
+
+ [DllImport(Libraries.AppCommon, EntryPoint = "app_get_res_control_global_resource_path")]
+ internal static extern AppCommonErrorCode AppGetResControlGlobalResourcePath(string applicationId, out string path);
}
}
* limitations under the License.
*/
+using System;
+using System.ComponentModel;
+using System.IO;
+
namespace Tizen.Applications
{
/// <summary>
return _expansionPackageResourcePath;
}
}
+
+ /// <summary>
+ /// Gets the absolute path to the application's resource control directory, which is used to share the allowed resources of the resource packages.
+ /// </summary>
+ /// <param name="resourceType">The resource type defined in the resource package</param>
+ /// <returns> The absolute path to the application's resource control directory, which is used to share the allowed resources of the resource packages.</returns>
+ /// <exception cref="ArgumentException">Thrown in case of an invalid parameter.</exception>
+ /// <exception cref="OutOfMemoryException">Thrown in case of out of memory.</exception>
+ /// <exception cref="DirectoryNotFoundException">Thrown in case of nonexistence of resource.</exception>
+ /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+ /// <since_tizen> 10 </since_tizen>
+ [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;
+ }
+
+ /// <summary>
+ /// Gets the absolute path to the application's resource control directory, which is used to share the global resources of the resource packages.
+ /// </summary>
+ /// <param name="resourceType">The resource type defined in the resource package</param>
+ /// <returns> The absolute path to the application's resource control directory, which is used to share the global resources of the resource packages.</returns>
+ /// <exception cref="ArgumentException">Thrown in case of an invalid parameter.</exception>
+ /// <exception cref="OutOfMemoryException">Thrown in case of out of memory.</exception>
+ /// <exception cref="DirectoryNotFoundException">Thrown in case of nonexistence of resource.</exception>
+ /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
+ /// <since_tizen> 10 </since_tizen>
+ [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;
+ }
}
}