[Calendar]Remove invalid exception
[platform/core/csapi/tizenfx.git] / src / Tizen.Pims.Calendar / Tizen.Pims.Calendar / CalendarDatabase.cs
index 60d9410..c088bd5 100644 (file)
@@ -25,23 +25,25 @@ namespace Tizen.Pims.Calendar
     /// CalendarDatabase provides methods to manage calendar information from/to the database.
     /// </summary>
     /// <remarks>
-    /// This class allows user to access/create/update db operations for calendar information.
+    /// This class allows user to access/create/update/delete db operations for calendar information.
+    /// CalendarDatabase is created by CalendarManager.
     /// </remarks>
+    /// <since_tizen> 4 </since_tizen>
     public class CalendarDatabase
     {
         private Object thisLock = new Object();
         private Dictionary<string, EventHandler<DBChangedEventArgs>> _eventHandlerMap = new Dictionary<string, EventHandler<DBChangedEventArgs>>();
         private Dictionary<string, Interop.Database.DBChangedCallback> _callbackMap = new Dictionary<string, Interop.Database.DBChangedCallback>();
-        private Interop.Database.DBChangedCallback _dbChangedDelegate;
 
         internal CalendarDatabase()
         {
-            ///To be created in CalendarManager only
+            /*To be created in CalendarManager only*/
         }
 
         /// <summary>
         /// The calendar database version.
         /// </summary>
+        /// <since_tizen> 4 </since_tizen>
         /// <value>The current calendar database version.</value>
         [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
         public int Version
@@ -61,6 +63,7 @@ namespace Tizen.Pims.Calendar
         /// <summary>
         /// Gets last successful changed calendar database version on the current connection.
         /// </summary>
+        /// <since_tizen> 4 </since_tizen>
         /// <returns>The last successful changed calendar database version on the current connection</returns>
         /// <privilege>http://tizen.org/privilege/calendar.read</privilege>
         /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
@@ -85,11 +88,13 @@ namespace Tizen.Pims.Calendar
         /// <summary>
         /// Inserts a record into the calendar database.
         /// </summary>
+        /// <since_tizen> 4 </since_tizen>
         /// <param name="record">The record to be inserted</param>
         /// <returns>The ID of inserted record</returns>
         /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
+        /// <feature>http://tizen.org/feature/calendar</feature>
+        /// <exception cref="NotSupportedException">Thrown when feature is not supported</exception>
         /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
-        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
         /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
         /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
@@ -109,14 +114,16 @@ namespace Tizen.Pims.Calendar
         /// <summary>
         /// Gets a record from the calendar database.
         /// </summary>
+        /// <since_tizen> 4 </since_tizen>
         /// <param name="viewUri">The view URI of a record</param>
         /// <param name="recordId">The record ID</param>
         /// <returns>
         /// The record associated with the record ID
         /// </returns>
         /// <privilege>http://tizen.org/privilege/calendar.read</privilege>
+        /// <feature>http://tizen.org/feature/calendar</feature>
+        /// <exception cref="NotSupportedException">Thrown when feature is not supported</exception>
         /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
-        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
         /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
         /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
@@ -142,10 +149,12 @@ namespace Tizen.Pims.Calendar
         /// <summary>
         /// Updates a record in the calendar database.
         /// </summary>
+        /// <since_tizen> 4 </since_tizen>
         /// <param name="record">The record to be updated</param>
         /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
+        /// <feature>http://tizen.org/feature/calendar</feature>
+        /// <exception cref="NotSupportedException">Thrown when feature is not supported</exception>
         /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
-        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
         /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
         /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
@@ -163,11 +172,13 @@ namespace Tizen.Pims.Calendar
         /// <summary>
         /// Deletes a record from the calendar database with related child records.
         /// </summary>
+        /// <since_tizen> 4 </since_tizen>
         /// <param name="viewUri">The view URI of a record</param>
         /// <param name="recordId">The record ID to be deleted</param>
         /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
+        /// <feature>http://tizen.org/feature/calendar</feature>
+        /// <exception cref="NotSupportedException">Thrown when feature is not supported</exception>
         /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
-        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
         /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
         /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
@@ -186,11 +197,13 @@ namespace Tizen.Pims.Calendar
         /// <summary>
         /// Replaces a record in the calendar database.
         /// </summary>
+        /// <since_tizen> 4 </since_tizen>
         /// <param name="record">The record to be replaced</param>
         /// <param name="id">the record id</param>
         /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
+        /// <feature>http://tizen.org/feature/calendar</feature>
+        /// <exception cref="NotSupportedException">Thrown when feature is not supported</exception>
         /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
-        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
         /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
         /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
@@ -208,6 +221,7 @@ namespace Tizen.Pims.Calendar
         /// <summary>
         /// Retrieves all records as a list.
         /// </summary>
+        /// <since_tizen> 4 </since_tizen>
         /// <param name="viewUri">The view URI to get records from</param>
         /// <param name="offset">The index from which results are received</param>
         /// <param name="limit">The maximum number of results(value 0 is used for all records)</param>
@@ -215,8 +229,9 @@ namespace Tizen.Pims.Calendar
         /// The record list
         /// </returns>
         /// <privilege>http://tizen.org/privilege/calendar.read</privilege>
+        /// <feature>http://tizen.org/feature/calendar</feature>
+        /// <exception cref="NotSupportedException">Thrown when feature is not supported</exception>
         /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
-        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
         /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
         /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
@@ -237,6 +252,7 @@ namespace Tizen.Pims.Calendar
         /// <summary>
         /// Retrieves records using a query.
         /// </summary>
+        /// <since_tizen> 4 </since_tizen>
         /// <param name="query">The query used to filter results</param>
         /// <param name="offset">The index from which results are received</param>
         /// <param name="limit">The maximum number of results(value 0 is used for all records)</param>
@@ -244,9 +260,9 @@ namespace Tizen.Pims.Calendar
         /// CalendarList
         /// </returns>
         /// <privilege>http://tizen.org/privilege/calendar.read</privilege>
+        /// <feature>http://tizen.org/feature/calendar</feature>
+        /// <exception cref="NotSupportedException">Thrown when feature is not supported</exception>
         /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
-        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
-        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
         /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
         [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
@@ -265,13 +281,15 @@ namespace Tizen.Pims.Calendar
         /// <summary>
         /// Inserts multiple records into the calendar database as a batch operation.
         /// </summary>
+        /// <since_tizen> 4 </since_tizen>
         /// <param name="list">The record list</param>
         /// <returns>
         /// The inserted record id array
         /// </returns>
         /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
+        /// <feature>http://tizen.org/feature/calendar</feature>
+        /// <exception cref="NotSupportedException">Thrown when feature is not supported</exception>
         /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
-        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
         /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
         /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
@@ -295,10 +313,12 @@ namespace Tizen.Pims.Calendar
         /// <summary>
         /// Updates multiple records into the calendar database as a batch operation.
         /// </summary>
+        /// <since_tizen> 4 </since_tizen>
         /// <param name="list">The record list</param>
         /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
+        /// <feature>http://tizen.org/feature/calendar</feature>
+        /// <exception cref="NotSupportedException">Thrown when feature is not supported</exception>
         /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
-        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
         /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
         /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
@@ -316,11 +336,13 @@ namespace Tizen.Pims.Calendar
         /// <summary>
         /// Deletes multiple records with related child records from the calendar database as a batch operation.
         /// </summary>
+        /// <since_tizen> 4 </since_tizen>
         /// <param name="viewUri">The view URI of the records to delete</param>
         /// <param name="idArray">The record IDs to delete</param>
         /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
+        /// <feature>http://tizen.org/feature/calendar</feature>
+        /// <exception cref="NotSupportedException">Thrown when feature is not supported</exception>
         /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
-        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
         /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
         /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
@@ -339,11 +361,12 @@ namespace Tizen.Pims.Calendar
         /// <summary>
         /// Deletes multiple records with related child records from the calendar database as a batch operation.
         /// </summary>
+        /// <since_tizen> 4 </since_tizen>
         /// <param name="list">The record list</param>
         /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
+        /// <feature>http://tizen.org/feature/calendar</feature>
+        /// <exception cref="NotSupportedException">Thrown when feature is not supported</exception>
         /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
-        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
-        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
         /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
         public void Delete(CalendarList list)
@@ -386,11 +409,13 @@ namespace Tizen.Pims.Calendar
         /// <summary>
         /// Replaces multiple records in the calendar database as a batch operation.
         /// </summary>
+        /// <since_tizen> 4 </since_tizen>
         /// <param name="list">The record list</param>
         /// <param name="idArray">The record IDs</param>
         /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
+        /// <feature>http://tizen.org/feature/calendar</feature>
+        /// <exception cref="NotSupportedException">Thrown when feature is not supported</exception>
         /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
-        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
         /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
         /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
@@ -408,6 +433,7 @@ namespace Tizen.Pims.Calendar
         /// <summary>
         /// Retrieves records with the given calendar database version.
         /// </summary>
+        /// <since_tizen> 4 </since_tizen>
         /// <param name="viewUri">The view URI to get records from</param>
         /// <param name="BookId">The calendar book ID to filter</param>
         /// <param name="calendarDBVersion">The calendar database version</param>
@@ -416,8 +442,9 @@ namespace Tizen.Pims.Calendar
         /// The record list
         /// </returns>
         /// <privilege>http://tizen.org/privilege/calendar.read</privilege>
+        /// <feature>http://tizen.org/feature/calendar</feature>
+        /// <exception cref="NotSupportedException">Thrown when feature is not supported</exception>
         /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
-        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
         /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
         /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
@@ -438,6 +465,7 @@ namespace Tizen.Pims.Calendar
         /// <summary>
         /// Gets the record count of a specific view.
         /// </summary>
+        /// <since_tizen> 4 </since_tizen>
         /// <param name="viewUri">The view URI to get records from</param>
         /// <returns>
         /// The count of records
@@ -460,6 +488,7 @@ namespace Tizen.Pims.Calendar
         /// <summary>
         /// Gets the record count with a query.
         /// </summary>
+        /// <since_tizen> 4 </since_tizen>
         /// <param name="query">The query used for filtering the results</param>
         /// <returns>
         /// The count of records
@@ -480,10 +509,17 @@ namespace Tizen.Pims.Calendar
 
         /// <summary>
         /// Registers a callback function to be invoked when a record changes.
+        /// <since_tizen> 4 </since_tizen>
         /// </summary>
         /// <param name="viewUri">The view URI of the record to subscribe for change notifications</param>
         /// <param name="DBChanged">The EventHandler to register</param>
         /// <privilege>http://tizen.org/privilege/calendar.read</privilege>
+        /// <feature>http://tizen.org/feature/calendar</feature>
+        /// <exception cref="NotSupportedException">Thrown when feature is not supported</exception>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
         [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")]
         public void AddDBChangedDelegate(string viewUri, EventHandler<DBChangedEventArgs> DBChanged)
         {
@@ -497,7 +533,7 @@ namespace Tizen.Pims.Calendar
                                        _eventHandlerMap[uri]?.Invoke(this, args);
                                };
 
-                               int error = Interop.Database.AddChangedCallback(viewUri, _dbChangedDelegate, IntPtr.Zero);
+                               int error = Interop.Database.AddChangedCallback(viewUri, _callbackMap[viewUri], IntPtr.Zero);
                                if (CalendarError.None != (CalendarError)error)
                                {
                                        Log.Error(Globals.LogTag, "AddDBChangedDelegate Failed with error " + error);
@@ -515,9 +551,15 @@ namespace Tizen.Pims.Calendar
         /// <summary>
         /// Deregisters a callback function.
         /// </summary>
+        /// <since_tizen> 4 </since_tizen>
         /// <param name="viewUri">The view URI of the record to subscribe for change notifications</param>
         /// <param name="DBChanged">The EventHandler to deregister</param>
         /// <privilege>http://tizen.org/privilege/calendar.read</privilege>
+        /// <feature>http://tizen.org/feature/calendar</feature>
+        /// <exception cref="NotSupportedException">Thrown when feature is not supported</exception>
+        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
         [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")]
         public void RemoveDBChangedDelegate(string viewUri, EventHandler<DBChangedEventArgs> DBChanged)
         {
@@ -544,11 +586,13 @@ namespace Tizen.Pims.Calendar
         /// <summary>
         /// Link a record to another record.
         /// </summary>
+        /// <since_tizen> 4 </since_tizen>
         /// <param name="baseId">The base record ID</param>
         /// <param name="recordId">The record ID to link to</param>
         /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
+        /// <feature>http://tizen.org/feature/calendar</feature>
+        /// <exception cref="NotSupportedException">Thrown when feature is not supported</exception>
         /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
-        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
         /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
         /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
@@ -567,10 +611,12 @@ namespace Tizen.Pims.Calendar
         /// <summary>
         /// Unlink a record from base record.
         /// </summary>
+        /// <since_tizen> 4 </since_tizen>
         /// <param name="recordId">The record ID to unlink</param>
         /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
+        /// <feature>http://tizen.org/feature/calendar</feature>
+        /// <exception cref="NotSupportedException">Thrown when feature is not supported</exception>
         /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
-        /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
         /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
         /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>