Esempio n. 1
0
        /// <summary>
        /// Gets the display name of the given privilege.
        /// </summary>
        /// <since_tizen> 3 </since_tizen>
        /// <remarks>If there's no matching privilege, then it returns last token of the given privilege.</remarks>
        /// <param name="apiVersion">The API version.</param>
        /// <param name="privilege">The privilege.</param>
        /// <param name="packageType">The type of application package.</param>
        /// <returns>The display name of the given privilege at the given API version and the package type.</returns>
        /// <exception cref="System.ArgumentNullException">Thrown when there is a null parameter.</exception>
        /// <exception cref="System.ArgumentException">Thrown when there is an invalid parameter.</exception>
        /// <exception cref="System.OutOfMemoryException">Thrown when out of memory occurs.</exception>
        /// <exception cref="System.InvalidOperationException">Thrown when an internal error occurs.</exception>
        public static string GetDisplayName(string apiVersion, string privilege, PackageType packageType)
        {
            string displayName;

            if (apiVersion == null || privilege == null)
            {
                PrivilegeErrorFactory.ThrowException(new ArgumentNullException(), "apiVersion and privilege should not be null.");
            }
            PrivilegeErrorFactory.CheckNThrowException(
                Interop.Privilege.GetDisplayNameByPkgtype(ToPackageTypeString(packageType), apiVersion, privilege, out displayName),
                "Failed to Get Privilege's Display Name.");
            return(displayName);
        }
Esempio n. 2
0
        /// <summary>
        /// Gets the display name of the privacy group in which the given privilege is included.
        /// </summary>
        /// <since_tizen> 3 </since_tizen>
        /// <param name="privilege">The privilege.</param>
        /// <remarks>The privilege must be privacy related.</remarks>
        /// <returns>The privacy group's display name that the given privilege is included in.</returns>
        /// <exception cref="System.ArgumentNullException">Thrown when there is a null parameter.</exception>
        /// <exception cref="System.ArgumentException">Thrown when there is an invalid parameter.</exception>
        /// <exception cref="System.OutOfMemoryException">Thrown when out of memory occurs.</exception>
        /// <exception cref="System.InvalidOperationException">Thrown when an internal error occurs.</exception>
        public static string GetPrivacyDisplayName(string privilege)
        {
            string displayName;

            if (privilege == null)
            {
                PrivilegeErrorFactory.ThrowException(new ArgumentNullException(), "privilege should not be null.");
            }
            PrivilegeErrorFactory.CheckNThrowException(
                Interop.Privilege.GetPrivacyDisplayName(privilege, out displayName),
                "Failed to Get Privacy's Display Name in Which the Given Privilege is included.");
            return(displayName);
        }
Esempio n. 3
0
        /// <summary>
        /// Gets the status of the given privacy related privilege.
        /// </summary>
        /// <since_tizen> 3 </since_tizen>
        /// <param name="privilege">The privilege.</param>
        /// <remarks>The privilege must be privacy related.</remarks>
        /// <returns>Status true if the privilege is on and false if the privilege is off.</returns>
        /// <exception cref="System.ArgumentNullException">Thrown when there is a null parameter.</exception>
        /// <exception cref="System.ArgumentException">Thrown when there is an invalid parameter.</exception>
        /// <exception cref="System.OutOfMemoryException">Thrown when out of memory occurs.</exception>
        /// <exception cref="System.InvalidOperationException">Thrown when an internal error occurs.</exception>
        public static bool GetPrivacyPrivilegeStatus(string privilege)
        {
            bool status;

            if (privilege == null)
            {
                PrivilegeErrorFactory.ThrowException(new ArgumentNullException(), "privilege should not be null.");
            }
            PrivilegeErrorFactory.CheckNThrowException(
                Interop.Privilege.GetPrivacyPrivilegeStatus(privilege, out status),
                "Failed to Get Privacy Privilege's Status.");
            return(status);
        }
Esempio n. 4
0
        /// <summary>
        /// Gets the description of the given privilege.
        /// </summary>
        /// <since_tizen> 3 </since_tizen>
        /// <remarks>If there's no matching privilege, then it returns description string for undefined privilege.</remarks>
        /// <param name="apiVersion">The API version.</param>
        /// <param name="privilege">The privilege.</param>
        /// <returns>The description of given privilege at the given API version</returns>
        /// <exception cref="System.ArgumentNullException">Thrown when there is a null parameter.</exception>
        /// <exception cref="System.ArgumentException">Thrown when there is an invalid parameter.</exception>
        /// <exception cref="System.OutOfMemoryException">Thrown when out of memory occurs.</exception>
        /// <exception cref="System.InvalidOperationException">Thrown when an internal error occurs.</exception>
        public static string GetDescription(string apiVersion, string privilege)
        {
            string description;

            if (apiVersion == null || privilege == null)
            {
                PrivilegeErrorFactory.ThrowException(new ArgumentNullException(), "apiVersion and privilege should not be null.");
            }
            PrivilegeErrorFactory.CheckNThrowException(
                Interop.Privilege.GetDescription(apiVersion, privilege, out description),
                "Failed to Get Privilege's Description.");
            return(description);
        }