[Calendar] Fix Validator issues 52/147352/3
authorJeesun Kim <iamjs.kim@samsung.com>
Mon, 4 Sep 2017 05:28:01 +0000 (14:28 +0900)
committerJeesun Kim <iamjs.kim@samsung.com>
Mon, 4 Sep 2017 07:22:54 +0000 (16:22 +0900)
Change-Id: I6023c2bef1d161976714d02d022306b93375552d

src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarDatabase.cs
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarFilter.cs
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarList.cs
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarManager.cs
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarReminder.cs
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarStructs.cs
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarTypes.cs
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarVcalendar.cs
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarViews.cs
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/ReminderEventArgs.cs

index 0b75c81..acd1670 100644 (file)
@@ -19,18 +19,19 @@ using System.Collections.Generic;
 using System.Runtime.InteropServices;
 using System.Diagnostics.CodeAnalysis;
 
-/// <summary>
-/// The Calendar Service API provides functions, enumerations used in the entire Content Service.
-/// </summary>
-/// <remarks>
-/// The Calendar Service API provides functions and ienumerations used in the entire Content Service.
-/// The Information about calendar items i.e. book, event, todo, alarm, attendee and extended are managed in the database
-/// and operations that involve database requires an active connection with the calendar service.
-/// </remarks>
-
 namespace Tizen.Pims.Calendar
 {
     /// <summary>
+    /// Delegate for detecting the calendar database changes.
+    /// </summary>
+    /// <param name="uri">The record uri</param>
+    /// <remarks>
+    /// The delegate must be registered using AddDBChangedDelegate.
+    /// It's invoked when the designated view changes.
+    /// </remarks>
+    public delegate void CalendarDBChanged(string uri);
+
+    /// <summary>
     /// CalendarDatabase provides methods to manage calendar information from/to the database.
     /// </summary>
     /// <remarks>
@@ -38,16 +39,6 @@ namespace Tizen.Pims.Calendar
     /// </remarks>
     public class CalendarDatabase
     {
-        /// <summary>
-        /// Delegete for detecting the calendar database changes.
-        /// </summary>
-        /// <param name="uri">The record uri</param>
-        /// <remarks>
-        /// The delegate must be registered using AddDBChangedDelegate.
-        /// It's invoked when the designated view changes.
-        /// </remarks>
-        public delegate void CalendarDBChanged(string uri);
-
         private Object thisLock = new Object();
         private Dictionary<string, CalendarDBChanged> _callbackMap = new Dictionary<string, CalendarDBChanged>();
         private Dictionary<string, Interop.Database.DBChangedCallback> _delegateMap = new Dictionary<string, Interop.Database.DBChangedCallback>();
@@ -430,7 +421,7 @@ namespace Tizen.Pims.Calendar
         /// <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>
-        /// <param name="currentDBVersion"The current calendar database versio></param>
+        /// <param name="currentDBVersion">The current calendar database versio></param>
         /// <returns>
         /// The record list
         /// </returns>
@@ -518,7 +509,7 @@ namespace Tizen.Pims.Calendar
                 Log.Error(Globals.LogTag, "AddDBChangedDelegate Failed with error " + error);
                 throw CalendarErrorFactory.GetException(error);
             }
-            _callbackMap[viewUri] = callback;
+            _callbackMap[viewUri] += callback;
             _delegateMap[viewUri] = _dbChangedDelegate;
         }
 
@@ -539,7 +530,7 @@ namespace Tizen.Pims.Calendar
                 Log.Error(Globals.LogTag, "RemoveDBChangedDelegate Failed with error " + error);
                 throw CalendarErrorFactory.GetException(error);
             }
-            _callbackMap.Remove(viewUri);
+            _callbackMap[viewUri] -= callback;
             _delegateMap.Remove(viewUri);
         }
 
index 431fb1b..9ca6b53 100644 (file)
@@ -267,6 +267,7 @@ namespace Tizen.Pims.Calendar
         /// <summary>
         /// Dispose
         /// </summary>
+        /// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
         protected virtual void Dispose(bool disposing)
         {
             if (!disposedValue)
index 0c5ac4a..c462db9 100644 (file)
@@ -74,7 +74,7 @@ namespace Tizen.Pims.Calendar
         }
 
         /// <summary>
-        /// Destory CalendarList resource.
+        /// Destroy CalendarList resource.
         /// </summary>
         ~CalendarList()
         {
index cce5eb0..d289ec4 100644 (file)
@@ -15,7 +15,6 @@
  */
 
 using System;
-using System.Diagnostics.CodeAnalysis;
 
 namespace Tizen.Pims.Calendar
 {
@@ -42,7 +41,7 @@ namespace Tizen.Pims.Calendar
         }
 
         /// <summary>
-        /// Destory CalendarManager resource.
+        /// Destroy CalendarManager resource.
         /// </summary>
         ~CalendarManager()
         {
index 4063591..f5e3760 100644 (file)
@@ -52,6 +52,7 @@ namespace Tizen.Pims.Calendar
         public void Dispose()
         {
             Dispose(true);
+            GC.SuppressFinalize(this);
         }
 #endregion
 
@@ -78,7 +79,6 @@ namespace Tizen.Pims.Calendar
                     if (CalendarError.None != (CalendarError)error)
                     {
                         Log.Error(Globals.LogTag, "Add reminder Failed with error " + error);
-                        throw CalendarErrorFactory.GetException(error);
                     }
                 }
                 s_reminderAlerted += value;
@@ -96,7 +96,6 @@ namespace Tizen.Pims.Calendar
                     if (CalendarError.None != (CalendarError)error)
                     {
                         Log.Error(Globals.LogTag, "Remove reminder Failed with error " + error);
-                        throw CalendarErrorFactory.GetException(error);
                     }
                 }
             }
index 2087cc3..ed69c5b 100644 (file)
@@ -81,7 +81,7 @@ namespace Tizen.Pims.Calendar
         /// <summary>
         /// Get localTime
         /// </summary>
-        /// <value>The localtime</value>
+        /// <value>The Localtime</value>
         public DateTime LocalTime
         {
             get;
@@ -110,8 +110,18 @@ namespace Tizen.Pims.Calendar
                 return LocalTime.CompareTo(other.LocalTime);
         }
 
-        public bool Equals(CalendarTime other)
+        /// <summary>
+        /// Equals CalendarTime
+        /// </summary>
+        /// <param name="other">The CalendarTime to be compared</param>
+        /// <returns>
+        /// A 32-bit signed integer that indicates the relative order of the objects being compared.
+        /// </returns>
+        /// <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>
+        public override bool Equals(object obj)
         {
+            var other = obj as CalendarTime;
             if (_type != other._type)
             {
                 Log.Error(Globals.LogTag, "Not to compare with different type");
index 43bcf24..dbd1933 100644 (file)
 namespace Tizen.Pims.Calendar
 {
        /// <summary>
-    /// This class provides enumurations about calendar inforamtion.
+    /// This class provides enumurations about calendar information.
        /// </summary>
     /// <remarks>
-    /// Most enumurations are based on vcalendar, icalendar(ver 2.0) specification.
+    /// Most enumerations are based on vcalendar, icalendar(ver 2.0) specification.
     /// https://www.ietf.org/rfc/rfc2445.txt
     /// </remarks>
        public static class CalendarTypes
@@ -276,7 +276,7 @@ namespace Tizen.Pims.Calendar
                        /// </summary>
                        Gregorian,
                        /// <summary>
-                       /// East asian lunisolar calendar
+                       /// East Asian lunisolar calendar
                        /// </summary>
                        Lunisolar,
                }
index c064da4..fc272b4 100644 (file)
@@ -22,6 +22,7 @@ namespace Tizen.Pims.Calendar
     /// Parsing vcalendar file callback function.
     /// </summary>
     /// <param name="record">The record</param>
+    /// <returns></returns>
     public delegate bool ParseCallback(CalendarRecord record);
 
     /// <summary>
@@ -76,7 +77,7 @@ namespace Tizen.Pims.Calendar
         }
 
         /// <summary>
-        /// Parse vcalendar file with foreach
+        /// Parse vcalendar file with ForEach
         /// </summary>
         /// <param name="path">The file path of the vCalendar stream file</param>
         /// <param name="callback">he callback function to invoke</param>
@@ -95,7 +96,7 @@ namespace Tizen.Pims.Calendar
             error = Interop.Vcalendar.ParseForEach(path, cb, IntPtr.Zero);
             if (CalendarError.None != (CalendarError)error)
             {
-                Log.Error(Globals.LogTag, "Parse foreach Vcalendar Failed [" + error + "]");
+                Log.Error(Globals.LogTag, "Parse ForEach Vcalendar Failed [" + error + "]");
                 throw CalendarErrorFactory.GetException(error);
             }
         }
index cd649a7..d711daa 100644 (file)
@@ -62,6 +62,8 @@ namespace Tizen.Pims.Calendar
 
             internal enum Id : uint
             {
+                None,
+
                 /// book
                 BookId          = (Book|DataTypeInteger|PropertyReadOnly),
                 BookUid         = (Book|DataTypeString) + 1,
@@ -341,7 +343,7 @@ namespace Tizen.Pims.Calendar
         }
 
         /// <summary>
-        /// Describes properies of a Book record.
+        /// Describes properties of a Book record.
         /// </summary>
         public static class Book
         {
@@ -412,8 +414,9 @@ namespace Tizen.Pims.Calendar
         }
 
         /// <summary>
-        /// Describes properies of a Event record.
+        /// Describes properties of a Event record.
         /// </summary>
+        [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords")]
         public static class Event
         {
             /// <summary>
@@ -659,7 +662,7 @@ namespace Tizen.Pims.Calendar
         }
 
         /// <summary>
-        /// Describes properies of a Todo record.
+        /// Describes properties of a Todo record.
         /// </summary>
         public static class Todo
         {
@@ -862,7 +865,7 @@ namespace Tizen.Pims.Calendar
         }
 
         /// <summary>
-        /// Describes properies of a Timezone record.
+        /// Describes properties of a Timezone record.
         /// </summary>
         public static class Timezone
         {
@@ -933,7 +936,7 @@ namespace Tizen.Pims.Calendar
         }
 
         /// <summary>
-        /// Describes properies of a Attendee record.
+        /// Describes properties of a Attendee record.
         /// </summary>
         public static class Attendee
         {
@@ -1000,7 +1003,7 @@ namespace Tizen.Pims.Calendar
         }
 
         /// <summary>
-        /// Describes properies of a Alarm record.
+        /// Describes properties of a Alarm record.
         /// </summary>
         public static class Alarm
         {
@@ -1043,7 +1046,7 @@ namespace Tizen.Pims.Calendar
         }
 
         /// <summary>
-        /// Describes properies of a InstanceUtimeBook record.
+        /// Describes properties of a InstanceUtimeBook record.
         /// </summary>
         /// <remarks>Read only view</remarks>
         public static class InstanceUtimeBook
@@ -1127,7 +1130,7 @@ namespace Tizen.Pims.Calendar
         }
 
         /// <summary>
-        /// Describes properies of a InstanceLocaltimeBook record.
+        /// Describes properties of a InstanceLocaltimeBook record.
         /// </summary>
         /// <remarks>Read only view</remarks>
         public static class InstanceLocaltimeBook
@@ -1215,7 +1218,7 @@ namespace Tizen.Pims.Calendar
         }
 
         /// <summary>
-        /// Describes properies of a InstanceUtimeBookExtended record.
+        /// Describes properties of a InstanceUtimeBookExtended record.
         /// </summary>
         /// <remarks>Read only view</remarks>
         public static class InstanceUtimeBookExtended
@@ -1323,7 +1326,7 @@ namespace Tizen.Pims.Calendar
         }
 
         /// <summary>
-        /// Describes properies of a InstanceLocaltimeBookExtended record.
+        /// Describes properties of a InstanceLocaltimeBookExtended record.
         /// </summary>
         /// <remarks>Read only view</remarks>
         public static class InstanceLocaltimeBookExtended
@@ -1435,7 +1438,7 @@ namespace Tizen.Pims.Calendar
         }
 
         /// <summary>
-        /// Describes properies of a UpdatedInfo record.
+        /// Describes properties of a UpdatedInfo record.
         /// </summary>
         /// <remarks>Read only view</remarks>
         public static class UpdatedInfo
@@ -1463,7 +1466,7 @@ namespace Tizen.Pims.Calendar
         }
 
         /// <summary>
-        /// Describes properies of a Extended record.
+        /// Describes properties of a Extended record.
         /// </summary>
         public static class Extended
         {
index 678a093..aa4e020 100644 (file)
@@ -15,7 +15,6 @@
  */
 
 using System;
-using System.Collections.Generic;
 
 namespace Tizen.Pims.Calendar
 {
@@ -31,8 +30,11 @@ namespace Tizen.Pims.Calendar
         }
 
         /// <summary>
-        /// The paramter which data is combinded(Value string like id=value&amp;time=value&amp;tick=value&amp;unit=value&amp;type=value)
+        /// The parameter which data is combinded.
         /// </summary>
+        /// <value>
+        /// The combination of reminder data(Value string like id=value&amp;time=value&amp;tick=value&amp;unit=value&amp;type=value)
+        /// </value>
         public string Param
         {
             get;