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>
/// </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>();
/// <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>
Log.Error(Globals.LogTag, "AddDBChangedDelegate Failed with error " + error);
throw CalendarErrorFactory.GetException(error);
}
- _callbackMap[viewUri] = callback;
+ _callbackMap[viewUri] += callback;
_delegateMap[viewUri] = _dbChangedDelegate;
}
Log.Error(Globals.LogTag, "RemoveDBChangedDelegate Failed with error " + error);
throw CalendarErrorFactory.GetException(error);
}
- _callbackMap.Remove(viewUri);
+ _callbackMap[viewUri] -= callback;
_delegateMap.Remove(viewUri);
}
/// <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)
}
/// <summary>
- /// Destory CalendarList resource.
+ /// Destroy CalendarList resource.
/// </summary>
~CalendarList()
{
*/
using System;
-using System.Diagnostics.CodeAnalysis;
namespace Tizen.Pims.Calendar
{
}
/// <summary>
- /// Destory CalendarManager resource.
+ /// Destroy CalendarManager resource.
/// </summary>
~CalendarManager()
{
public void Dispose()
{
Dispose(true);
+ GC.SuppressFinalize(this);
}
#endregion
if (CalendarError.None != (CalendarError)error)
{
Log.Error(Globals.LogTag, "Add reminder Failed with error " + error);
- throw CalendarErrorFactory.GetException(error);
}
}
s_reminderAlerted += value;
if (CalendarError.None != (CalendarError)error)
{
Log.Error(Globals.LogTag, "Remove reminder Failed with error " + error);
- throw CalendarErrorFactory.GetException(error);
}
}
}
/// <summary>
/// Get localTime
/// </summary>
- /// <value>The localtime</value>
+ /// <value>The Localtime</value>
public DateTime LocalTime
{
get;
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");
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
/// </summary>
Gregorian,
/// <summary>
- /// East asian lunisolar calendar
+ /// East Asian lunisolar calendar
/// </summary>
Lunisolar,
}
/// Parsing vcalendar file callback function.
/// </summary>
/// <param name="record">The record</param>
+ /// <returns></returns>
public delegate bool ParseCallback(CalendarRecord record);
/// <summary>
}
/// <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>
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);
}
}
internal enum Id : uint
{
+ None,
+
/// book
BookId = (Book|DataTypeInteger|PropertyReadOnly),
BookUid = (Book|DataTypeString) + 1,
}
/// <summary>
- /// Describes properies of a Book record.
+ /// Describes properties of a Book record.
/// </summary>
public static class Book
{
}
/// <summary>
- /// Describes properies of a Event record.
+ /// Describes properties of a Event record.
/// </summary>
+ [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords")]
public static class Event
{
/// <summary>
}
/// <summary>
- /// Describes properies of a Todo record.
+ /// Describes properties of a Todo record.
/// </summary>
public static class Todo
{
}
/// <summary>
- /// Describes properies of a Timezone record.
+ /// Describes properties of a Timezone record.
/// </summary>
public static class Timezone
{
}
/// <summary>
- /// Describes properies of a Attendee record.
+ /// Describes properties of a Attendee record.
/// </summary>
public static class Attendee
{
}
/// <summary>
- /// Describes properies of a Alarm record.
+ /// Describes properties of a Alarm record.
/// </summary>
public static class Alarm
{
}
/// <summary>
- /// Describes properies of a InstanceUtimeBook record.
+ /// Describes properties of a InstanceUtimeBook record.
/// </summary>
/// <remarks>Read only view</remarks>
public static class InstanceUtimeBook
}
/// <summary>
- /// Describes properies of a InstanceLocaltimeBook record.
+ /// Describes properties of a InstanceLocaltimeBook record.
/// </summary>
/// <remarks>Read only view</remarks>
public static class InstanceLocaltimeBook
}
/// <summary>
- /// Describes properies of a InstanceUtimeBookExtended record.
+ /// Describes properties of a InstanceUtimeBookExtended record.
/// </summary>
/// <remarks>Read only view</remarks>
public static class InstanceUtimeBookExtended
}
/// <summary>
- /// Describes properies of a InstanceLocaltimeBookExtended record.
+ /// Describes properties of a InstanceLocaltimeBookExtended record.
/// </summary>
/// <remarks>Read only view</remarks>
public static class InstanceLocaltimeBookExtended
}
/// <summary>
- /// Describes properies of a UpdatedInfo record.
+ /// Describes properties of a UpdatedInfo record.
/// </summary>
/// <remarks>Read only view</remarks>
public static class UpdatedInfo
}
/// <summary>
- /// Describes properies of a Extended record.
+ /// Describes properties of a Extended record.
/// </summary>
public static class Extended
{
*/
using System;
-using System.Collections.Generic;
namespace Tizen.Pims.Calendar
{
}
/// <summary>
- /// The paramter which data is combinded(Value string like id=value&time=value&tick=value&unit=value&type=value)
+ /// The parameter which data is combinded.
/// </summary>
+ /// <value>
+ /// The combination of reminder data(Value string like id=value&time=value&tick=value&unit=value&type=value)
+ /// </value>
public string Param
{
get;