[TCSACR-81][ADD] Added new property to get account handle 00/146400/1
authorJooseok Song <seogii.song@samsung.com>
Mon, 28 Aug 2017 09:49:43 +0000 (18:49 +0900)
committerJooseok Song <seogii.song@samsung.com>
Mon, 28 Aug 2017 09:49:43 +0000 (18:49 +0900)
Change-Id: Id177d5b51c8e94072914c7f869f3f1cb6fa5fa4c

src/Tizen.Account.AccountManager/Interop/Interop.Account.cs
src/Tizen.Account.AccountManager/Interop/Interop.AccountProvider.cs
src/Tizen.Account.AccountManager/Interop/Interop.AccountService.cs
src/Tizen.Account.AccountManager/Interop/Interop.Libraries.cs
src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/Account.cs
src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountEnums.cs
src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountErrorFactory.cs
src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountProvider.cs
src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountService.cs
src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountSubscriberEventArgs.cs
src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/SafeAccountHandle.cs [new file with mode: 0644]

index 9789044..90489bc 100644 (file)
@@ -18,127 +18,128 @@ using System;
 using System.Runtime.InteropServices;
 using Tizen.Account.AccountManager;
 /// <summary>
-/// Interop for Account class APIs
+/// Interop for Account class APIs.
 /// </summary>
 /// <since_tizen> 3 </since_tizen>
 internal static partial class Interop
 {
     /// <summary>
-    /// Interop for Account class APIs
+    /// Interop for Account class APIs.
     /// </summary>
     /// <since_tizen> 3 </since_tizen>
     internal static partial class Account
     {
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_create", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int Create(out IntPtr handle);
+        internal static extern int Create(out SafeAccountHandle handle);
+
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_destroy", CallingConvention = CallingConvention.Cdecl)]
         internal static extern int Destroy(IntPtr handle);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_account_id", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int GetAccountId(IntPtr data, out int accountId);
+        internal static extern int GetAccountId(SafeAccountHandle data, out int accountId);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_user_name", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int GetAccountUserName(IntPtr data, out string userName);
+        internal static extern int GetAccountUserName(SafeAccountHandle data, out string userName);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_user_name", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int SetAccountUserName(IntPtr handle, string userName);
+        internal static extern int SetAccountUserName(SafeAccountHandle handle, string userName);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_display_name", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int GetAccountDisplayName(IntPtr handle, out string displayName);
+        internal static extern int GetAccountDisplayName(SafeAccountHandle handle, out string displayName);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_display_name", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int SetAccountDisplayName(IntPtr handle, string displayName);
+        internal static extern int SetAccountDisplayName(SafeAccountHandle handle, string displayName);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_capability", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int GetAccountCapability(IntPtr handle, string capabilityType, out int capabilityValue);
+        internal static extern int GetAccountCapability(SafeAccountHandle handle, string capabilityType, out int capabilityValue);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_capability", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int SetAccountCapability(IntPtr handle, string capabilityType, int capabilityValue);
+        internal static extern int SetAccountCapability(SafeAccountHandle handle, string capabilityType, int capabilityValue);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_icon_path", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int GetAccountIconPath(IntPtr handle, out string iconPath);
+        internal static extern int GetAccountIconPath(SafeAccountHandle handle, out string iconPath);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_icon_path", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int SetAccountIconPath(IntPtr handle, string iconPath);
+        internal static extern int SetAccountIconPath(SafeAccountHandle handle, string iconPath);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_domain_name", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int GetAccountDomainName(IntPtr handle, out string domainName);
+        internal static extern int GetAccountDomainName(SafeAccountHandle handle, out string domainName);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_domain_name", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int SetAccountDomainName(IntPtr handle, string domainName);
+        internal static extern int SetAccountDomainName(SafeAccountHandle handle, string domainName);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_email_address", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int GetAccountEmail(IntPtr handle, out string email);
+        internal static extern int GetAccountEmail(SafeAccountHandle handle, out string email);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_email_address", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int SetAccountEmail(IntPtr handle, string email);
+        internal static extern int SetAccountEmail(SafeAccountHandle handle, string email);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_package_name", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int GetAccountPackageName(IntPtr handle, out string name);
+        internal static extern int GetAccountPackageName(SafeAccountHandle handle, out string name);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_package_name", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int SetAccountPackageName(IntPtr handle, string name);
+        internal static extern int SetAccountPackageName(SafeAccountHandle handle, string name);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_access_token", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int GetAccountAccessToken(IntPtr handle, out string accessToken);
+        internal static extern int GetAccountAccessToken(SafeAccountHandle handle, out string accessToken);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_access_token", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int SetAccountAccessToken(IntPtr handle, string accessToken);
+        internal static extern int SetAccountAccessToken(SafeAccountHandle handle, string accessToken);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_user_text", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int GetAccountUserText(IntPtr handle, int index, out string userText);
+        internal static extern int GetAccountUserText(SafeAccountHandle handle, int index, out string userText);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_user_text", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int SetAccountUserText(IntPtr handle, int index, string userText);
+        internal static extern int SetAccountUserText(SafeAccountHandle handle, int index, string userText);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_user_int", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int GetAccountUserInt(IntPtr handle, int index, out int value);
+        internal static extern int GetAccountUserInt(SafeAccountHandle handle, int index, out int value);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_user_int", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int SetAccountUserInt(IntPtr handle, int index, int value);
+        internal static extern int SetAccountUserInt(SafeAccountHandle handle, int index, int value);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_auth_type", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int GetAccountAuthType(IntPtr handle, out int authType);
+        internal static extern int GetAccountAuthType(SafeAccountHandle handle, out int authType);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_auth_type", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int SetAccountAuthType(IntPtr handle, int authType);
+        internal static extern int SetAccountAuthType(SafeAccountHandle handle, int authType);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_secret", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int GetAccountSercet(IntPtr handle, out int secretType);
+        internal static extern int GetAccountSercet(SafeAccountHandle handle, out int secretType);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_secret", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int SetAccountSecret(IntPtr handle, int secretType);
+        internal static extern int SetAccountSecret(SafeAccountHandle handle, int secretType);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_sync_support", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int GetAccountSyncSupport(IntPtr handle, out int syncType);
+        internal static extern int GetAccountSyncSupport(SafeAccountHandle handle, out int syncType);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_sync_support", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int SetAccountSyncSupport(IntPtr handle, int syncType);
+        internal static extern int SetAccountSyncSupport(SafeAccountHandle handle, int syncType);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_source", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int GetAccountSource(IntPtr handle, out string source);
+        internal static extern int GetAccountSource(SafeAccountHandle handle, out string source);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_source", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int SetAccountSource(IntPtr handle, string source);
+        internal static extern int SetAccountSource(SafeAccountHandle handle, string source);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_custom", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int GetAccountCustomValue(IntPtr handle, string key, out string value);
+        internal static extern int GetAccountCustomValue(SafeAccountHandle handle, string key, out string value);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_custom", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int SetAccountCustomValue(IntPtr handle, string key, string value);
+        internal static extern int SetAccountCustomValue(SafeAccountHandle handle, string key, string value);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_update_sync_status_by_id", CallingConvention = CallingConvention.Cdecl)]
         internal static extern int UpdateAccountSyncStatusById(int accountId, int status);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_capability_all")]
-        internal static extern int GetAllAccountCapabilities(IntPtr handle, AccountCapabilityCallback callback, IntPtr userData);
+        internal static extern int GetAllAccountCapabilities(SafeAccountHandle handle, AccountCapabilityCallback callback, IntPtr userData);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_query_capability_by_account_id")]
         internal static extern int QueryAccountCapabilityById(AccountCapabilityCallback callback, int accountId, IntPtr userData);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_custom_all")]
-        internal static extern int GetAllAccountCustomValues(IntPtr handle, AccountCustomCallback callback, IntPtr userData);
+        internal static extern int GetAllAccountCustomValues(SafeAccountHandle handle, AccountCustomCallback callback, IntPtr userData);
 
         //Callbacks
         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
index f201061..02f6314 100644 (file)
@@ -19,13 +19,13 @@ using System.Runtime.InteropServices;
 using Tizen.Account.AccountManager;
 
 /// <summary>
-/// Interop for AccountProvider class APIs
+/// Interop for AccountProvider class APIs.
 /// </summary>
 /// <since_tizen> 3 </since_tizen>
 internal static partial class Interop
 {
     /// <summary>
-    /// Interop for AccountProvider class APIs
+    /// Interop for AccountProvider class APIs.
     /// </summary>
     /// <since_tizen> 3 </since_tizen>
     internal static partial class AccountProvider
index 7bb1275..1995ce0 100644 (file)
 
 using System;
 using System.Runtime.InteropServices;
+using Tizen.Account.AccountManager;
 
 /// <summary>
-/// Interop for Account class APIs
+/// Interop for Account class APIs.
 /// </summary>
 /// <since_tizen> 3 </since_tizen>
 internal static partial class Interop
 {
     /// <summary>
-    /// Interop for Account class APIs
+    /// Interop for Account class APIs.
     /// </summary>
     /// <since_tizen> 3 </since_tizen>
     internal static partial class AccountService
     {
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_update_to_db_by_id", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int UpdateAccountToDBById(IntPtr handle, int id);
+        internal static extern int UpdateAccountToDBById(SafeAccountHandle handle, int id);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_update_to_db_by_user_name", CallingConvention = CallingConvention.Cdecl)]
         internal static extern int UpdateAccountToDBByUserName(IntPtr handle, string userName, string packageName);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_query_account_by_account_id", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int QueryAccountById(int accountId, out IntPtr handle);
+        internal static extern int QueryAccountById(int accountId, ref SafeAccountHandle handle);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_query_account_by_user_name", CallingConvention = CallingConvention.Cdecl)]
         internal static extern int QueryAccountByUserName(Interop.Account.AccountCallback callback, string userName, IntPtr userData);
@@ -51,7 +52,7 @@ internal static partial class Interop
         internal static extern int UpdateAccountSyncStatusById(int accoutId, int status);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_insert_to_db", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern int AddAccount(IntPtr handle, out int accountId);
+        internal static extern int AddAccount(SafeAccountHandle handle, out int accountId);
 
         [DllImport(Libraries.AccountSvc, EntryPoint = "account_delete_from_db_by_id", CallingConvention = CallingConvention.Cdecl)]
         internal static extern int DeleteAccountById(int accountId);
index f1530bd..dba2781 100644 (file)
  */
 
 /// <summary>
-/// Interop for Library reference
+/// Interop for the library reference.
 /// </summary>
 /// <since_tizen> 3 </since_tizen>
 internal static partial class Interop
 {
     /// <summary>
-    /// Interop for Library reference
+    /// Interop for the library reference.
     /// </summary>
     /// <since_tizen> 3 </since_tizen>
     internal static partial class Libraries
index df10a15..498bb84 100644 (file)
@@ -20,29 +20,31 @@ using System.Collections.Generic;
 namespace Tizen.Account.AccountManager
 {
     /// <summary>
-    /// Represents the Account Information.
+    /// Represents the account information.
     /// </summary>
     /// <since_tizen> 3 </since_tizen>
     public class Account : IDisposable
     {
-        private IntPtr _handle = IntPtr.Zero;
-        internal Account(IntPtr handle)
+        private readonly SafeAccountHandle _handle;
+
+        public Account(SafeAccountHandle handle)
         {
-            Handle = handle;
+            _handle = handle;
         }
 
         ~Account()
         {
             Dispose(false);
         }
+
         /// <summary>
-        /// Creates a new Account instance.
+        /// Creates a new account instance.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         /// <returns>Account Instance.</returns>
         public static Account CreateAccount()
         {
-            IntPtr handle;
+            SafeAccountHandle handle;
             AccountError err = (AccountError)Interop.Account.Create(out handle);
             if (err != AccountError.None)
             {
@@ -56,7 +58,7 @@ namespace Tizen.Account.AccountManager
         /// Id of the Account.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <remarks>Account Id shall be created only when account is added to the database.</remarks>
+        /// <remarks>Account ID shall be created only when the account is added to the database.</remarks>
         public int AccountId
         {
             get
@@ -73,10 +75,10 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// UserName of the Account.
+        /// UserName of the account.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <value>User Name of the Account.</value>
+        /// <value>User name of the account.</value>
         public string UserName
         {
             get
@@ -102,10 +104,10 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Display Name of the Account.
+        /// Display name of the account.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <value>DisplayName of the  Account.</value>
+        /// <value>Display name of the account.</value>
         public string DisplayName
         {
             get
@@ -131,10 +133,10 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Icon path of the Account.
+        /// Icon path of the account.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <value>Icon path of the Account.</value>
+        /// <value>Icon path of the account.</value>
         public string IconPath
         {
             get
@@ -160,10 +162,10 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Domain name of the Account.
+        /// Domain name of the account.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <value>Domain name of the Account.</value>
+        /// <value>Domain name of the account.</value>
         public string DomainName
         {
             get
@@ -189,10 +191,10 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Email Id of the Account.
+        /// Email ID of the account.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <value>Email Id of the Account.</value>
+        /// <value>Email ID of the account.</value>
         public string EmailId
         {
             get
@@ -218,10 +220,10 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Package Name of the Account.
+        /// Package name of the account.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <value>Package Name.</value>
+        /// <value>Package name of the account.</value>
         public string PackageName
         {
             get
@@ -247,10 +249,10 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Access Token of the Account.
+        /// Access token of the account.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <value>Access Token.</value>
+        /// <value>Access token of the account.</value>
         public string AccessToken
         {
             get
@@ -276,10 +278,10 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Authentication type of the Account.
+        /// Authentication type of the account.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <value>Authentication type.</value>
+        /// <value>Authentication type of the account.</value>
         public AccountAuthType AuthType
         {
             get
@@ -305,10 +307,10 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Secrecy State of the Account.
+        /// Secrecy state of the account.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <value>Secrecy State.</value>
+        /// <value>Secrecy state of the account.</value>
         public AccountSecrecyState SecrecyState
         {
             get
@@ -334,10 +336,10 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Sync State of the Account.
+        /// Sync state of the account.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <value>Sync State.</value>
+        /// <value>Sync state of the account.</value>
         public AccountSyncState SyncState
         {
             get
@@ -363,10 +365,10 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Source of the Account .
+        /// Source of the account.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <value>Account Source.</value>
+        /// <value>Account source.</value>
         public string Source
         {
             get
@@ -391,25 +393,25 @@ namespace Tizen.Account.AccountManager
             }
         }
 
-        internal IntPtr Handle
+               /// <summary>
+        /// Handle of the account.
+        /// </summary>
+        /// <since_tizen> 4 </since_tizen>
+        /// <value>Account handle.</value>
+        public SafeAccountHandle SafeAccountHandle
         {
             get
             {
                 return _handle;
             }
-
-            set
-            {
-                _handle = value;
-            }
         }
         /// <summary>
         /// Sets the account capability.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <param name="capabilityType"> The Account capability type</param>
-        /// <param name="state">The Account capability state</param>
-        /// <exception cref="ArgumentException">In case of invalid parameters</exception>
+        /// <param name="capabilityType"> The account capability type.</param>
+        /// <param name="state">The account capability state.</param>
+        /// <exception cref="ArgumentException">In case of an invalid parameter.</exception>
         public void SetCapability(string capabilityType, CapabilityState state)
         {
             AccountError ret = (AccountError)Interop.Account.SetAccountCapability(_handle, capabilityType, (int)state);
@@ -419,12 +421,12 @@ namespace Tizen.Account.AccountManager
             }
         }
         /// <summary>
-        /// Gets all the capabilities of an account.
+        /// Gets all the capabilities of the account.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         /// <param name="capabilityType"> The capability type to get the capability value.</param>
-        /// <returns>The capability value (on/off) of the specified CapabilityState .</returns>
-        /// <exception cref="ArgumentException">In case of invalid parameters</exception>
+        /// <returns>The capability value (on/off) of the specified CapabilityState.</returns>
+        /// <exception cref="ArgumentException">In case of an invalid parameter.</exception>
         public CapabilityState GetCapability(string capabilityType)
         {
             int type;
@@ -438,10 +440,10 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Gets all the capabilities of an account.
+        /// Gets all the capabilities of the account.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <returns>List of Cpabailities as Dictionary</returns>
+        /// <returns>List of capabilities as dictionary.</returns>
         public Dictionary<string, CapabilityState> GetAllCapabilities()
         {
 
@@ -463,12 +465,12 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Sets the Custom Value to the Account.
+        /// Sets the custom value to the account.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <param name="key">key to be added to the Account.</param>
-        /// <param name="value">value to be updated for respective key for the Account.</param>
-        /// <exception cref="ArgumentException">In case of invalid parameters</exception>
+        /// <param name="key">Key to be added to the account.</param>
+        /// <param name="value">Value to be updated for respective key for the account.</param>
+        /// <exception cref="ArgumentException">In case of an invalid parameter.</exception>
         public void SetCustomValue(string key, string value)
         {
             AccountError err = (AccountError)Interop.Account.SetAccountCustomValue(_handle, key, value);
@@ -482,10 +484,10 @@ namespace Tizen.Account.AccountManager
         /// Gets the user specific custom text of an account key.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <param name="key">The key to retrieve custom text .</param>
-        /// <returns>The text of the given key</returns>
-        /// <exception cref="ArgumentException">In case of invalid parameters</exception>
-        /// <exception cref="InvalidOperationException">If there is no given capability type in the account </exception>
+        /// <param name="key">The key to retrieve custom text.</param>
+        /// <returns>The text of the given key.</returns>
+        /// <exception cref="ArgumentException">In case of an invalid parameter.</exception>
+        /// <exception cref="InvalidOperationException">If there is no given capability type in the account.</exception>
         public string GetCustomValue(string key)
         {
             string result = "";
@@ -499,10 +501,10 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Gets All the custome values.
+        /// Gets all the custom values.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <returns>List of custom key, value pairs as Dictionary.</returns>
+        /// <returns>List of custom key, value pairs as dictionary.</returns>
         public Dictionary<string, string> GetAllCustomValues()
         {
             AccountError res = AccountError.None;
@@ -528,9 +530,9 @@ namespace Tizen.Account.AccountManager
         /// Sets the user text.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <param name="index">The index of the user text (must be in range from 0 to 4) </param>
-        /// <param name="text">The text string to set as the user text</param>
-        /// <exception cref="ArgumentException">In case of invalid parameters</exception>
+        /// <param name="index">The index of the user text (must be in range from 0 to 4).</param>
+        /// <param name="text">The text string to set as the user text.</param>
+        /// <exception cref="ArgumentException">In case of an invalid parameter.</exception>
         public void SetUserText(int index, string text)
         {
             AccountError err = (AccountError)Interop.Account.SetAccountUserText(_handle, index, text);
@@ -544,10 +546,10 @@ namespace Tizen.Account.AccountManager
         /// Gets the user text.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <param name="index">The index of the user text (range: 0 ~ 4)</param>
-        /// <returns>The user text of the given key</returns>
-        /// <exception cref="ArgumentException">In case of invalid parameters</exception>
-        /// <exception cref="OutOfMemoryException">In case of out of memory</exception>
+        /// <param name="index">The index of the user text (must be in range from 0 to 4).</param>
+        /// <returns>The user text of the given key.</returns>
+        /// <exception cref="ArgumentException">In case of an invalid parameter.</exception>
+        /// <exception cref="OutOfMemoryException">In case of out of memory.</exception>
         public string GetUserText(int index)
         {
             string result = "";
@@ -561,12 +563,12 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Gets the user int value.
+        /// Gets the user integer value.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <param name="index">The index of the user int (range: 0 ~ 4)</param>
-        /// <returns>The user int of the given key</returns>
-        /// <exception cref="ArgumentException">In case of invalid parameters</exception>
+        /// <param name="index">The index of the user integer (must be in range from 0 to 4).</param>
+        /// <returns>The user integer of the given key.</returns>
+        /// <exception cref="ArgumentException">In case of an invalid parameter.</exception>
         public int GetUserInt(int index)
         {
             int result = -1;
@@ -583,9 +585,9 @@ namespace Tizen.Account.AccountManager
         /// Sets the user integer value.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <param name="index">The index of the user integer (must be in range from 0 to 4) </param>
-        /// <param name="value">The integer to set as the user integer</param>
-        /// <exception cref="ArgumentException">In case of invalid parameters</exception>
+        /// <param name="index">The index of the user integer (must be in range from 0 to 4).</param>
+        /// <param name="value">The integer to set as the user integer.</param>
+        /// <exception cref="ArgumentException">In case of an invalid parameter.</exception>
         public void SetUserInt(int index, int value)
         {
             AccountError err = (AccountError)Interop.Account.SetAccountUserInt(_handle, index, value);
@@ -596,7 +598,7 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Overloaded Dispose API for destroying the Account Handle.
+        /// Overloaded Dispose API for destroying the account handle.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         public void Dispose()
@@ -609,10 +611,12 @@ namespace Tizen.Account.AccountManager
         {
             if (!disposing)
             {
-                if (_handle != IntPtr.Zero)
-                {
-                    _handle = IntPtr.Zero;
-                }
+                //if (_handle != IntPtr.Zero)
+                //{
+                //    _handle = IntPtr.Zero;
+                //}
+                //_handle.Dispose();
+                GC.SuppressFinalize(this);
             }
         }
     }
index b55a458..68a7a65 100644 (file)
 namespace Tizen.Account.AccountManager
 {
     /// <summary>
-    /// Enumeration for the state of capability
+    /// Enumeration for the state of capability.
     /// </summary>
     /// <since_tizen> 3 </since_tizen>
     public enum CapabilityState
     {
         /// <summary>
-        /// Account capability is invalid
+        /// Account capability is invalid.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         InvalidState,
 
         /// <summary>
-        /// Account capability is disabled
+        /// Account capability is disabled.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         Disabled,
 
         /// <summary>
-        /// Account capability is enabled
+        /// Account capability is enabled.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         Enabled
@@ -47,19 +47,19 @@ namespace Tizen.Account.AccountManager
     public enum AccountSecrecyState
     {
         /// <summary>
-        /// Account secrecy is invalid
+        /// Account secrecy is invalid.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         InvalidState,
 
         /// <summary>
-        /// Account is not visible
+        /// Account is not visible.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         Invisible,
 
         /// <summary>
-        /// Account is visible
+        /// Account is visible.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         Visible
@@ -72,31 +72,31 @@ namespace Tizen.Account.AccountManager
     public enum AccountSyncState
     {
         /// <summary>
-        /// Account sync is invalid
+        /// Account sync is invalid.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         InvalidState,
 
         /// <summary>
-        /// Account sync not supported
+        /// Account sync not supported.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         NotSupported,
 
         /// <summary>
-        /// Account sync supported but all synchronization functionalities are off
+        /// Account sync supported, but all the synchronization functionalities are off.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         Off,
 
         /// <summary>
-        /// Account sync support and sync status is idle
+        /// Account sync supported and sync status is idle.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         Idle,
 
         /// <summary>
-        /// Account sync support and sync status is running
+        /// Acount sync supported and sync status is running.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         Running
@@ -109,36 +109,36 @@ namespace Tizen.Account.AccountManager
     public enum AccountAuthType
     {
         /// <summary>
-        /// Auth type is invalid
+        /// Auth type is invalid.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         Invalid,
 
         /// <summary>
-        /// XAuth type
+        /// XAuth type.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         XAuth,
 
         /// <summary>
-        /// OAuth type
+        /// OAuth type.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         OAuth,
 
         /// <summary>
-        /// Client-Login type
+        /// ClientLogin type.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         ClientLogin
     }
 
     /// <summary>
-    /// Account information change notification type
+    /// Account information change notification types.
     /// </summary>
     /// <since_tizen> 3 </since_tizen>
     /// <remarks>
-    /// When the account database is changed, You can distinguish one event type from the other which are set for subscribing notification.
+    /// When the account database is changed, you can distinguish one event type from the other which are set for subscribing notification.
     /// </remarks>
     public enum AccountNotificationType
     {
index 48f9164..51c31dd 100644 (file)
@@ -20,7 +20,7 @@ using Tizen;
 namespace Tizen.Account.AccountManager
 {
     /// <summary>
-    /// Enum to give the type of error occured, if any.
+    /// Enumeration for the types of error occured, if any.
     /// </summary>
     /// <since_tizen> 3 </since_tizen>
     public enum AccountError
@@ -42,22 +42,22 @@ namespace Tizen.Account.AccountManager
         /// <since_tizen> 3 </since_tizen>
         OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory,
         /// <summary>
-        /// Same user name exists in your application
+        /// Same user name exists in your application.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         Duplcated = -0x01000000 | 0x01,
         /// <summary>
-        /// Empty Data
+        /// Empty data.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         NoData = Tizen.Internals.Errors.ErrorCode.NoData,
         /// <summary>
-        /// elated record does not exist
+        /// Elated record does not exist.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         RecordNotFound = -0x01000000 | 0x03,
         /// <summary>
-        /// Invalid Operation.
+        /// Invalid operation.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         InvalidOperation = Tizen.Internals.Errors.ErrorCode.InvalidOperation,
@@ -72,17 +72,17 @@ namespace Tizen.Account.AccountManager
         /// <since_tizen> 3 </since_tizen>
         DBNotOpened = -0x01000000 | 0x05,
         /// <summary>
-        /// DB query syntax error
+        /// DB query syntax error.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         QuerySyntaxError = -0x01000000 | 0x06,
         /// <summary>
-        /// Iterator has reached the end
+        /// Iterator has reached the end.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         IteratorEnd = -0x01000000 | 0x07,
         /// <summary>
-        /// Notification failed
+        /// Notification failed.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         NotificationFailed = -0x01000000 | 0x08,
@@ -92,12 +92,12 @@ namespace Tizen.Account.AccountManager
         /// <since_tizen> 3 </since_tizen>
         PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied,
         /// <summary>
-        /// XML parse failed
+        /// XML parse failed.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         XMLParseFailed = -0x01000000 | 0x0a,
         /// <summary>
-        /// XML File not found
+        /// XML file not found.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         XMLFileNotFound = -0x01000000 | 0x0b,
@@ -107,7 +107,7 @@ namespace Tizen.Account.AccountManager
         /// <since_tizen> 3 </since_tizen>
         EventSubscriptionFailed = -0x01000000 | 0x0c,
         /// <summary>
-        /// Account provider is not registered
+        /// Account provider is not registered.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         ProviderNotRegistered = -0x01000000 | 0x0d,
@@ -117,7 +117,7 @@ namespace Tizen.Account.AccountManager
         /// <since_tizen> 3 </since_tizen>
         MultipleNotAllowed = -0x01000000 | 0x0e,
         /// <summary>
-        /// SQLite busy handler expired
+        /// SQLite busy handler expired.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         DBBusy = -0x01000000 | 0x10
index 606a286..ce34491 100644 (file)
@@ -21,7 +21,7 @@ using Tizen.Internals.Errors;
 namespace Tizen.Account.AccountManager
 {
     /// <summary>
-    ///  Account Id.
+    /// The account ID.
     /// </summary>
     /// <since_tizen> 3 </since_tizen>
     public class AccountProvider : IDisposable
@@ -50,7 +50,7 @@ namespace Tizen.Account.AccountManager
             }
         }
         /// <summary>
-        ///  Account Id.
+        /// The account ID.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         public string AppId
@@ -69,7 +69,7 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        ///  Serviceprovider Id of the account provider.
+        /// Serviceprovider ID of the account provider.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         public string ServiceProviderId
@@ -88,7 +88,7 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        ///  Icon path of an account provider.
+        /// Icon path of the account provider.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         public string IconPath
@@ -107,7 +107,7 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        ///  Small icon path of an account provider.
+        /// Small icon path of the account provider.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         public string SmallIconPath
@@ -126,7 +126,7 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        ///  Flag for account provider If supports multiple accounts.
+        /// Flag for the account provider if it supports multiple accounts.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         public bool MultipleAccountSupport
@@ -149,11 +149,13 @@ namespace Tizen.Account.AccountManager
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         /// <privilege>http://tizen.org/privilege/account.read</privilege>
+        /// <feature>http://tizen.org/feature/account</feature>
         /// <returns>
-        /// list of capability information.
+        /// The list of capability information.
         /// </returns>
-        /// <exception cref="InvalidOperationException">In case of any DB error</exception>
+        /// <exception cref="InvalidOperationException">In case of any DB error.</exception>
         /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
         public IEnumerable<string> GetAllCapabilities()
         {
             List<string> capabilities = new List<string>();
@@ -174,17 +176,19 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Gets the specific label information detail of an account provider.
+        /// Gets the specific label information detail of the account provider.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         /// <param name="locale">
         /// The locale is specified as an ISO 3166 alpha-2 two letter country-code followed by ISO 639-1 for the two-letter language code.
         /// For example, "ko_KR" or "ko-kr" for Korean, "en_US" or "en-us" for American English.
         /// </param>
-        /// <returns>The label text given for the locale</returns>
+        /// <returns>The label text given for the locale.</returns>
         /// <privilege>http://tizen.org/privilege/account.read</privilege>
-        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given locale</exception>
+        /// <feature>http://tizen.org/feature/account</feature>
+        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given locale.</exception>
         /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
         public string GetLabel(string locale)
         {
             string label;
@@ -198,17 +202,19 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Gets the specific label information detail of an account provider.
+        /// Gets the specific label information detail of the account provider.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         /// <param name="appId">
-        /// The application ID to search
+        /// The application ID to search.
         /// </param>
-        /// <returns> All the labels information for the given application Id.</returns>
+        /// <returns> All the labels information for the given application ID.</returns>
         /// <privilege>http://tizen.org/privilege/account.read</privilege>
-        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given appid</exception>
-        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <feature>http://tizen.org/feature/account</feature>
+        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given the application ID.</exception>
+        /// <exception cref="ArgumentException"> In case of an invalid parameter.</exception>
         /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
         public static Dictionary<string, string> GetLabelsByAppId(string appId)
         {
 
@@ -229,13 +235,15 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Gets the label information detail of an account provider.
+        /// Gets the label information detail of the account provider.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         /// <returns> All the labels information for the given account provider.</returns>
         /// <privilege>http://tizen.org/privilege/account.read</privilege>
-        /// <exception cref="InvalidOperationException">In case of any DB error</exception>
+        /// <feature>http://tizen.org/feature/account</feature>
+        /// <exception cref="InvalidOperationException">In case of any DB error.</exception>
         /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
         public Dictionary<string, string> GetLabels()
         {
 
@@ -262,9 +270,11 @@ namespace Tizen.Account.AccountManager
         /// <param name="appId">The application ID to check.</param>
         /// <returns>returns true If App is supported </returns>
         /// <privilege>http://tizen.org/privilege/account.read</privilege>
-        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given appid</exception>
-        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <feature>http://tizen.org/feature/account</feature>
+        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for the given application ID.</exception>
+        /// <exception cref="ArgumentException"> In case of an invalid parameter.</exception>
         /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
         public bool IsAppSupported(string appId)
         {
             bool isSupported = false;
@@ -286,16 +296,18 @@ namespace Tizen.Account.AccountManager
         /// Checks whether the given application ID supports the capability.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <param name="appId">The application Id</param>
-        /// <param name="capability">The capability information</param>
+        /// <param name="appId">The application ID.</param>
+        /// <param name="capability">The capability information.</param>
         /// <returns>
         /// TRUE if the application supports the given capability,
         /// otherwise FALSE if the application does not support the given capability
         /// </returns>
         /// <privilege>http://tizen.org/privilege/account.read</privilege>
-        /// <exception cref="InvalidOperationException">In case of any DB error</exception>
-        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <feature>http://tizen.org/feature/account</feature>
+        /// <exception cref="InvalidOperationException">In case of any DB error.</exception>
+        /// <exception cref="ArgumentException"> In case of an invalid parameter.</exception>
         /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
         public static bool IsFeatureSupportedByApp(string appId, string capability)
         {
             bool supported = Interop.AccountProvider.IsFeatureSupported(appId, capability);
@@ -313,15 +325,17 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        ///     Retrieves capability information with application ID.
+        /// Retrieves capability information with the application ID.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <param name="appId">application Id</param>
+        /// <param name="appId">The application ID.</param>
         /// <returns> Capability information list for the given appId.</returns>
         /// <privilege>http://tizen.org/privilege/account.read</privilege>
-        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given appid</exception>
-        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <feature>http://tizen.org/feature/account</feature>
+        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for the given application ID.</exception>
+        /// <exception cref="ArgumentException"> In case of an invalid parameter.</exception>
         /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
         public static IEnumerable<string> GetFeaturesByAppId(string appId)
         {
 
index fc7cbd4..d335a8e 100644 (file)
@@ -20,16 +20,16 @@ using System.Collections.Generic;
 namespace Tizen.Account.AccountManager
 {
     /// <summary>
-    /// The AccountManager APIs is separated into two major sections:
+    /// The AccountManager APIs are separated into two major sections:
     /// 1. Registering an account provider while an application is installed. This information will be used for the Add account screen.
     /// 2. Adding an account information when an application signs in successfully to share the account information to the Tizen system. This information will be shown in the Tizen settings account menu.
     ///
     /// The APIs of both of the sections consist of the following functionality:
     /// <list>
-    /// <item> Create an account or account provider </item>
-    /// <item> Update an account or account provider(Only available for the creator) </item>
-    /// <item> Delete an account or account provider(Only available for the creator) </item>
-    /// <item> Read an account or account provider with some filter </item>
+    /// <item> Create an account or account provider.</item>
+    /// <item> Update an account or account provider (Only available for the creator).</item>
+    /// <item> Delete an account or account provider (Only available for the creator).</item>
+    /// <item> Read an account or account provider with some filter.</item>
     /// </list>
     /// </summary>
     /// <since_tizen> 3 </since_tizen>
@@ -37,74 +37,76 @@ namespace Tizen.Account.AccountManager
     public static class AccountService
     {
         /// <summary>
-        /// This is contact capability string.
+        /// This is the contact capability string.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         public static readonly string ContactCapability = "http://tizen.org/account/capability/contact";
 
         /// <summary>
-        /// This is calendar capability string.
+        /// This is the calendar capability string.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         public static readonly string CalendarCapability = "http://tizen.org/account/capability/calendar";
 
         /// <summary>
-        /// This is email capability string.
+        /// This is the email capability string.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         public static readonly string EmailCapability = "http://tizen.org/account/capability/email";
 
         /// <summary>
-        /// This is photo capability string.
+        /// This is the photo capability string.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         public static readonly string PhotoCapability = "http://tizen.org/account/capability/photo";
 
         /// <summary>
-        /// This is video capability string.
+        /// This is the video capability string.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         public static readonly string VideoCapability = "http://tizen.org/account/capability/video";
 
         /// <summary>
-        /// This is music capability string.
+        /// This is the music capability string.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         public static readonly string MusicCapability = "http://tizen.org/account/capability/music";
 
         /// <summary>
-        /// This is document capability string.
+        /// This is the document capability string.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         public static readonly string DocumentCapability = "http://tizen.org/account/capability/document";
 
         /// <summary>
-        /// This is message capability string.
+        /// This is the message capability string.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         public static readonly string MessageCapability = "http://tizen.org/account/capability/message";
 
         /// <summary>
-        /// This is game capability string.
+        /// This is the game capability string.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         public static readonly string GameCapability = "http://tizen.org/account/capability/game";
 
         /// <summary>
-        /// Retrieves all accounts details from the account database.
+        /// Retrieves all the accounts details from the account database.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <returns>List of Accounts</returns>
+        /// <returns>List of accounts.</returns>
         /// <privilege>http://tizen.org/privilege/account.read</privilege>
-        /// <exception cref="InvalidOperationException">In case of any DB error. </exception>
+        /// <feature>http://tizen.org/feature/account</feature>
+        /// <exception cref="InvalidOperationException">In case of any DB error.</exception>
         /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
         public static IEnumerable<Account> GetAccountsAsync()
         {
             List<Account> accounts = new List<Account>();
             List<int> values = new List<int>();
             Interop.Account.AccountCallback accountCallback = (IntPtr data, IntPtr userdata) =>
             {
-                Account account = new Account(data);
+                Account account = new Account(new SafeAccountHandle(data, true));
                 values.Add(account.AccountId);
                 account.Dispose();
                 return true;
@@ -126,37 +128,42 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Retrieve an account with the account ID.
+        /// Retrieves the account with the account ID.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <param name="accountId"> The account Id to be searched.</param>
-        /// <returns>Account instance with reference to the given id.</returns>
+        /// <param name="accountId"> The account ID to be searched.</param>
+        /// <returns>Account instance with reference to the given ID.</returns>
         /// <privilege>http://tizen.org/privilege/account.read</privilege>
-        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given account id</exception>
-        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <feature>http://tizen.org/feature/account</feature>
+        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given account ID.</exception>
+        /// <exception cref="ArgumentException"> In case of an invalid parameter.</exception>
         /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
         public static Account GetAccountById(int accountId)
         {
             Account account = Account.CreateAccount();
-            IntPtr handle = account.Handle;
-            AccountError res = (AccountError)Interop.AccountService.QueryAccountById(accountId, out handle);
+            SafeAccountHandle handle = account.SafeAccountHandle;
+
+            AccountError res = (AccountError)Interop.AccountService.QueryAccountById(accountId, ref handle);
             if (res != AccountError.None)
             {
                 throw AccountErrorFactory.CreateException(res, "Failed to get accounts from the database for account id: " + accountId);
             }
-
-            account.Handle = handle;
-            return account;
+            Account ref_account = new Account(handle);
+                       
+            return ref_account;
         }
 
         /// <summary>
-        /// Retrieves all AccountProviders details from the account database.
+        /// Retrieves all the AccountProviders details from the account database.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <returns>List of AccountProviders</returns>
+        /// <returns>List of AccountProviders.</returns>
         /// <privilege>http://tizen.org/privilege/account.read</privilege>
-        /// <exception cref="InvalidOperationException">In case of any DB error</exception>
+        /// <feature>http://tizen.org/feature/account</feature>
+        /// <exception cref="InvalidOperationException">In case of any DB error.</exception>
         /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
         public static IEnumerable<AccountProvider> GetAccountProviders()
         {
             List<string> values = new List<string>();
@@ -186,15 +193,17 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Retrieves the account provider information with application Id.
+        /// Retrieves the account provider information with the application ID.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <param name="appId">Application Id.</param>
-        /// <returns>The AccountProvider instance associated with the given application Id.</returns>
+        /// <param name="appId">The application ID.</param>
+        /// <returns>The AccountProvider instance associated with the given application ID.</returns>
         /// <privilege>http://tizen.org/privilege/account.read</privilege>
-        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given appid</exception>
-        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <feature>http://tizen.org/feature/account</feature>
+        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given appid.</exception>
+        /// <exception cref="ArgumentException"> In case of an invalid parameter.</exception>
         /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
         public static AccountProvider GetAccountProviderByAppId(string appId)
         {
             IntPtr handle;
@@ -214,11 +223,13 @@ namespace Tizen.Account.AccountManager
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         /// <param name="feature">The capability value to search for account providers.</param>
-        /// <returns>Retrieves AccountProviders information with the capability name.</returns>
+        /// <returns>Retrieves the AccountProviders information with the capability name.</returns>
         /// <privilege>http://tizen.org/privilege/account.read</privilege>
-        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given feature</exception>
-        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <feature>http://tizen.org/feature/account</feature>
+        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given feature.</exception>
+        /// <exception cref="ArgumentException"> In case of invalid parameter.</exception>
         /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
         public static IEnumerable<AccountProvider> GetAccountProvidersByFeature(string feature)
         {
             List<string> values = new List<string>();
@@ -247,16 +258,18 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Inserts into the Database with the new account Infomration.
+        /// Inserts into the Database with the new account Information.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         /// <param name="account">New Account instance to be added.</param>
         /// <privilege>http://tizen.org/privilege/account.read</privilege>
         /// <privilege>http://tizen.org/privilege/account.write </privilege>
-        /// <exception cref="InvalidOperationException">In case of any DB error</exception>
-        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <feature>http://tizen.org/feature/account</feature>
+        /// <exception cref="InvalidOperationException">In case of any DB error.</exception>
+        /// <exception cref="ArgumentException"> In case of an invalid parameter.</exception>
         /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
         /// <exception cref="OutOfMemoryException"> In case of OutOfMemory error.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
         public static int AddAccount(Account account)
         {
             if (account == null)
@@ -265,7 +278,7 @@ namespace Tizen.Account.AccountManager
             }
 
             int id = -1;
-            AccountError err = (AccountError)Interop.AccountService.AddAccount(account.Handle, out id);
+            AccountError err = (AccountError)Interop.AccountService.AddAccount(account.SafeAccountHandle, out id);
             if (err != AccountError.None)
             {
                 throw AccountErrorFactory.CreateException(err, "Failed to AddAccount");
@@ -278,13 +291,15 @@ namespace Tizen.Account.AccountManager
         /// Updates the account details to the account database.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <param name="account">account instance to be updated.</param>
+        /// <param name="account">Account instance to be updated.</param>
         /// <privilege>http://tizen.org/privilege/account.read</privilege>
         /// <privilege>http://tizen.org/privilege/account.write </privilege>
-        /// <exception cref="InvalidOperationException">In case of any DB error </exception>
-        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <feature>http://tizen.org/feature/account</feature>
+        /// <exception cref="InvalidOperationException">In case of any DB error.</exception>
+        /// <exception cref="ArgumentException"> In case of an invalid parameter.</exception>
         /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
         /// <exception cref="OutOfMemoryException"> In case of OutOfMemory error.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
         public static void UpdateAccount(Account account)
         {
             if (account == null)
@@ -292,7 +307,7 @@ namespace Tizen.Account.AccountManager
                 throw AccountErrorFactory.CreateException(AccountError.InvalidParameter, "Failed to UpdateAccount");
             }
 
-            AccountError err = (AccountError)Interop.AccountService.UpdateAccountToDBById(account.Handle, account.AccountId);
+            AccountError err = (AccountError)Interop.AccountService.UpdateAccountToDBById(account.SafeAccountHandle, account.AccountId);
             if (err != AccountError.None)
             {
                 throw AccountErrorFactory.CreateException(err, "Failed to UpdateAccount");
@@ -300,15 +315,17 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Deletes the account information from the Database.
+        /// Deletes the account information from the database.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         /// <param name="account">Account instance to be deleted from the database.</param>
         /// <privilege>http://tizen.org/privilege/account.read</privilege>
-        /// <privilege>http://tizen.org/privilege/account.write </privilege>
-        /// <exception cref="InvalidOperationException">In case of any DB error </exception>
-        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <privilege>http://tizen.org/privilege/account.write</privilege>
+        /// <feature>http://tizen.org/feature/account</feature>
+        /// <exception cref="InvalidOperationException">In case of any DB error.</exception>
+        /// <exception cref="ArgumentException"> In case of an invalid parameter.</exception>
         /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
         public static void DeleteAccount(Account account)
         {
             if (account == null)
@@ -324,16 +341,18 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Deletes an account from the account database by user name.
+        /// Deletes the account from the account database by user name.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         /// <param name="userName">The user name of the account to delete.</param>
         /// <param name="packageName">The package name of the account to delete.</param>
         /// <privilege>http://tizen.org/privilege/account.read</privilege>
-        /// <privilege>http://tizen.org/privilege/account.write </privilege>
-        /// <exception cref="InvalidOperationException">In case of any DB error</exception>
-        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <privilege>http://tizen.org/privilege/account.write</privilege>
+        /// <feature>http://tizen.org/feature/account</feature>
+        /// <exception cref="InvalidOperationException">In case of any DB error.</exception>
+        /// <exception cref="ArgumentException"> In case of an invalid parameter.</exception>
         /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
         public static void DeleteAccount(string userName, string packageName)
         {
             AccountError err = (AccountError)Interop.AccountService.DeleteAccountByUser(userName, packageName);
@@ -344,15 +363,17 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Deletes an account from the account database by package name.
+        /// Deletes the account from the account database by package name.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         /// <param name="packageName">The package name of the account to delete.</param>
         /// <privilege>http://tizen.org/privilege/account.read</privilege>
-        /// <privilege>http://tizen.org/privilege/account.write </privilege>
-        /// <exception cref="InvalidOperationException">In case of any DB error</exception>
-        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <privilege>http://tizen.org/privilege/account.write</privilege>
+        /// <feature>http://tizen.org/feature/account</feature>
+        /// <exception cref="InvalidOperationException">In case of any DB error.</exception>
+        /// <exception cref="ArgumentException"> In case of an invalid parameter.</exception>
         /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
         public static void DeleteAccount(string packageName)
         {
             AccountError err = (AccountError)Interop.AccountService.DeleteAccountByPackage(packageName);
@@ -364,22 +385,24 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Retrieves all accounts with the given user name.
+        /// Retrieves all the accounts with the given user name.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <param name="userName">The user name to search .</param>
-        /// <returns>Accounts list matched with the user name</returns>
+        /// <param name="userName">The user name to search.</param>
+        /// <returns>Accounts list matched with the user name.</returns>
         /// <privilege>http://tizen.org/privilege/account.read</privilege>
-        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given username</exception>
-        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <feature>http://tizen.org/feature/account</feature>
+        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given username.</exception>
+        /// <exception cref="ArgumentException"> In case of an invalid parameter.</exception>
         /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
         public static IEnumerable<Account> GetAccountsByUserName(string userName)
         {
             List<Account> accounts = new List<Account>();
             List<int> values = new List<int>();
             Interop.Account.AccountCallback accountCallback = (IntPtr handle, IntPtr data) =>
             {
-                Account account = new Account(handle);
+                Account account = new Account(new SafeAccountHandle(handle, true));
                 values.Add(account.AccountId);
                 account.Dispose();
                 return true;
@@ -401,22 +424,24 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Retrieves all accounts with the given package name.
+        /// Retrieves all the accounts with the given package name.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <param name="packageName"> The package name to Search</param>
-        /// <returns>Accounts list matched with the package name</returns>
+        /// <param name="packageName"> The package name to search.</param>
+        /// <returns>Accounts list matched with the package name.</returns>
         /// <privilege>http://tizen.org/privilege/account.read</privilege>
-        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given package name</exception>
-        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <feature>http://tizen.org/feature/account</feature>
+        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given package name.</exception>
+        /// <exception cref="ArgumentException"> In case of an invalid parameter.</exception>
         /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
         public static IEnumerable<Account> GetAccountsByPackageName(string packageName)
         {
             List<Account> accounts = new List<Account>();
             List<int> values = new List<int>();
             Interop.Account.AccountCallback accountCallback = (IntPtr handle, IntPtr data) =>
             {
-                Account account = new Account(handle);
+                Account account = new Account(new SafeAccountHandle(handle, true));
                 values.Add(account.AccountId);
                 account.Dispose();
                 return true;
@@ -438,22 +463,24 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Retrieves all accounts with the given cpability type.
+        /// Retrieves all accounts with the given capability type.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <param name="type"> Capability type</param>
-        /// <returns>Accounts list matched with the capability type</returns>
+        /// <param name="type"> Capability type.</param>
+        /// <returns>Accounts list matched with the capability type.</returns>
         /// <privilege>http://tizen.org/privilege/account.read</privilege>
-        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given capability type</exception>
-        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <feature>http://tizen.org/feature/account</feature>
+        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for the given capability type.</exception>
+        /// <exception cref="ArgumentException"> In case of an invalid parameter.</exception>
         /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
         public static IEnumerable<Account> GetAccountsByCapabilityType(string type)
         {
             List<Account> accounts = new List<Account>();
             List<int> values = new List<int>();
             Interop.Account.AccountCallback accountCallback = (IntPtr handle, IntPtr data) =>
             {
-                Account account = new Account(handle);
+                Account account = new Account(new SafeAccountHandle(handle, true));
                 values.Add(account.AccountId);
                 account.Dispose();
                 return true;
@@ -475,15 +502,17 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// Retrieves all capabilities with the given account
+        /// Retrieves all the capabilities with the given account.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <param name="accountId">account instance</param>
-        /// <returns>Capabilities list as Dictionary of Capability type and State.</returns>
+        /// <param name="accountId">Account instance.</param>
+        /// <returns>Capabilities list as dictionary of the capability type and state.</returns>
         /// <privilege>http://tizen.org/privilege/account.read</privilege>
-        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given account id</exception>
-        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <feature>http://tizen.org/feature/account</feature>
+        /// <exception cref="InvalidOperationException">In case of any DB error or record not found for given account ID.</exception>
+        /// <exception cref="ArgumentException"> In case of an invalid parameter.</exception>
         /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
         public static Dictionary<string, CapabilityState> GetCapabilitiesById(int accountId)
         {
             Dictionary<string, CapabilityState> capabilities = new Dictionary<string, CapabilityState>();
@@ -506,10 +535,12 @@ namespace Tizen.Account.AccountManager
         /// Gets the count of accounts in the account database.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <returns>The number of accounts in the database</returns>
+        /// <returns>The number of accounts in the database.</returns>
         /// <privilege>http://tizen.org/privilege/account.read</privilege>
-        /// <exception cref="InvalidOperationException">In case of any DB error </exception>
+        /// <feature>http://tizen.org/feature/account</feature>
+        /// <exception cref="InvalidOperationException">In case of any DB error.</exception>
         /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
         public static int GetAccountsCount()
         {
             int count = 0;
@@ -526,13 +557,15 @@ namespace Tizen.Account.AccountManager
         /// Updates the sync status of the given account.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <param name="account"> Account for which sync status needs to be updated</param>
+        /// <param name="account"> Account for which the sync status needs to be updated.</param>
         /// <param name="status">Sync State</param>
         /// <privilege>http://tizen.org/privilege/account.read</privilege>
         /// <privilege>http://tizen.org/privilege/account.write</privilege>
-        /// <exception cref="InvalidOperationException">In case of any DB error </exception>
-        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <feature>http://tizen.org/feature/account</feature>
+        /// <exception cref="InvalidOperationException">In case of any DB error.</exception>
+        /// <exception cref="ArgumentException"> In case of an invalid parameter.</exception>
         /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
         public static void UpdateSyncStatusById(Account account, AccountSyncState status)
         {
             AccountError err = (AccountError)Interop.AccountService.UpdateAccountSyncStatusById(account.AccountId, (int)status);
@@ -557,14 +590,16 @@ namespace Tizen.Account.AccountManager
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         /// <remarks>
-        /// ContentUpdate event is triggered if the MediaInformaion updated/deleted or new Inforamtion is Inserted.
+        /// ContentUpdate event is triggered if the MediaInformaion updated/deleted or new information is inserted.
         /// </remarks>
         /// <param name="sender"></param>
         /// <param name="e">A ContentUpdatedEventArgs object that contains information about the update operation.</param>
         /// <privilege>http://tizen.org/privilege/account.read</privilege>
-        /// <exception cref="InvalidOperationException">In case of any DB error </exception>
-        /// <exception cref="ArgumentException"> In case of invalid parameter</exception>
+        /// <feature>http://tizen.org/feature/account</feature>
+        /// <exception cref="InvalidOperationException">In case of any DB error.</exception>
+        /// <exception cref="ArgumentException"> In case of an invalid parameter.</exception>
         /// <exception cref="UnauthorizedAccessException"> In case of privilege not defined.</exception>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
         public static event EventHandler<AccountSubscriberEventArgs> AccountUpdated
         {
             add
index 153c427..2df2399 100644 (file)
@@ -19,7 +19,7 @@ using System;
 namespace Tizen.Account.AccountManager
 {
     /// <summary>
-    /// Event arguments passed when Event is triggered to notify that account is updated/removed from the account database.
+    /// Event arguments passed when the event is triggered to notify that the account is updated/removed from the account database.
     /// </summary>
     /// <since_tizen> 3 </since_tizen>
     public class AccountSubscriberEventArgs : EventArgs
@@ -51,7 +51,7 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// The account event type
+        /// The account event type.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         public AccountNotificationType EventType
@@ -61,7 +61,7 @@ namespace Tizen.Account.AccountManager
         }
 
         /// <summary>
-        /// The account ID to update
+        /// The account ID to update.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         public int AccountId
diff --git a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/SafeAccountHandle.cs b/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/SafeAccountHandle.cs
new file mode 100644 (file)
index 0000000..3da224c
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Account.AccountManager
+{
+    /// <summary>
+    /// Represents a wrapper class for a unmanaged Account handle.
+    /// </summary>
+    public sealed class SafeAccountHandle : SafeHandle
+    {
+        /// <summary>
+        /// Initializes a new instance of the SafeAppControlHandle class.
+        /// </summary>
+        public SafeAccountHandle() : base(IntPtr.Zero, true)
+        {
+        }
+
+        /// <summary>
+        /// Initializes a new instance of the SafeAccountHandle class.
+        /// </summary>
+        /// <param name="existingHandle">An IntPtr object that represents the pre-existing handle to use.</param>
+        /// <param name="ownsHandle">true to reliably release the handle during the finalization phase; false to prevent reliable release.</param>
+        public SafeAccountHandle(IntPtr existingHandle, bool ownsHandle) : base(IntPtr.Zero, ownsHandle)
+        {
+            SetHandle(existingHandle);
+        }
+
+        /// <summary>
+        /// Gets a value that indicates whether the handle is invalid.
+        /// </summary>
+        public override bool IsInvalid
+        {
+            get { return this.handle == IntPtr.Zero; }
+        }
+
+        /// <summary>
+        /// When overridden in a derived class, executes the code required to free the handle.
+        /// </summary>
+        /// <returns>true if the handle is released successfully</returns>
+        protected override bool ReleaseHandle()
+        {
+            this.SetHandle(IntPtr.Zero);
+            return true;
+        }
+    }
+}