Class CalendarDatabase
Definition
- Namespace:
- Tizen.Pims.Calendar
- Assembly:
- Tizen.Pims.Calendar.dll
- API Level:
- 4
The CalendarDatabase provides methods to manage calendar information from/to the database.
public class CalendarDatabase
- Inheritance
-
CalendarDatabase
Remarks
This class allows user to access/create/update/delete database operations for the calendar information. The CalendarDatabase is created by the CalendarManager.
Properties
View SourceLastChangeVersion
Gets the last successful changed calendar database version on the current connection.
Declaration
public int LastChangeVersion { get; }
Property Value
Type | Description |
---|---|
Int32 | The last successful changed calendar database version on the current connection. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when the method failed due to an invalid operation. |
OutOfMemoryException | Thrown when failed due to out of memory. |
UnauthorizedAccessException | Thrown when the application does not have proper privileges. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/calendar.read
View SourceVersion
The calendar database version.
Declaration
public int Version { get; }
Property Value
Type | Description |
---|---|
Int32 | The current calendar database version. |
API Level: 4
Methods
View SourceAddDBChangedDelegate(String, EventHandler<DBChangedEventArgs>)
Registers a callback function to be invoked when a record changes.
Declaration
public void AddDBChangedDelegate(string viewUri, EventHandler<DBChangedEventArgs> DBChanged)
Parameters
Type | Name | Description |
---|---|---|
String | viewUri | The view URI of the record to subscribe for change notifications. |
EventHandler<DBChangedEventArgs> | DBChanged | The EventHandler to register. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown when the feature is not supported. |
InvalidOperationException | Thrown when the method failed due to an invalid operation. |
ArgumentException | Thrown when one of the arguments provided to a method is not valid. |
OutOfMemoryException | Thrown when failed due to out of memory. |
UnauthorizedAccessException | Thrown when the application does not have proper privileges. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/calendar.read
Feature: http://tizen.org/feature/calendar
View SourceDelete(String, Int32)
Deletes a record from the calendar database with related child records.
Declaration
public void Delete(string viewUri, int recordId)
Parameters
Type | Name | Description |
---|---|---|
String | viewUri | The view URI of a record. |
Int32 | recordId | The record ID to be deleted. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown when the feature is not supported. |
InvalidOperationException | Thrown when the method failed due to an invalid operation. |
ArgumentException | Thrown when one of the arguments provided to a method is not valid. |
OutOfMemoryException | Thrown when failed due to out of memory. |
UnauthorizedAccessException | Thrown when the application does not have proper privileges. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/calendar.write
Feature: http://tizen.org/feature/calendar
View SourceDelete(String, Int32[])
Deletes multiple records with the related child records from the calendar database as a batch operation.
Declaration
public void Delete(string viewUri, int[] idArray)
Parameters
Type | Name | Description |
---|---|---|
String | viewUri | The view URI of the records to delete. |
Int32[] | idArray | The record IDs to delete. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown when the feature is not supported. |
InvalidOperationException | Thrown when the method failed due to an invalid operation. |
ArgumentException | Thrown when one of the arguments provided to a method is not valid. |
OutOfMemoryException | Thrown when failed due to out of memory. |
UnauthorizedAccessException | Thrown when the application does not have proper privileges. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/calendar.write
Feature: http://tizen.org/feature/calendar
View SourceDelete(CalendarList)
Deletes multiple records with the related child records from the calendar database as a batch operation.
Declaration
public void Delete(CalendarList list)
Parameters
Type | Name | Description |
---|---|---|
CalendarList | list | The record list. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown when the feature is not supported. |
InvalidOperationException | Thrown when the method failed due to an invalid operation. |
OutOfMemoryException | Thrown when failed due to out of memory. |
UnauthorizedAccessException | Thrown when the application does not have proper privileges. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/calendar.write
Feature: http://tizen.org/feature/calendar
View SourceGet(String, Int32)
Gets a record from the calendar database.
Declaration
public CalendarRecord Get(string viewUri, int recordId)
Parameters
Type | Name | Description |
---|---|---|
String | viewUri | The view URI of a record. |
Int32 | recordId | The record ID. |
Returns
Type | Description |
---|---|
CalendarRecord | The record associated with the record ID. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown when feature is not supported. |
InvalidOperationException | Thrown when the method failed due to an invalid operation. |
ArgumentException | Thrown when one of the arguments provided to a method is not valid. |
OutOfMemoryException | Thrown when failed due to out of memory. |
UnauthorizedAccessException | Thrown when the application does not have proper privileges. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/calendar.read
Feature: http://tizen.org/feature/calendar
View SourceGetAll(String, Int32, Int32)
Retrieves all the records as a list.
Declaration
public CalendarList GetAll(string viewUri, int offset, int limit)
Parameters
Type | Name | Description |
---|---|---|
String | viewUri | The view URI to get records from. |
Int32 | offset | The index from which results are received. |
Int32 | limit | The maximum number of results (value 0 is used for all the records). |
Returns
Type | Description |
---|---|
CalendarList | The record list. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown when the feature is not supported. |
InvalidOperationException | Thrown when the method failed due to an invalid operation. |
ArgumentException | Thrown when one of the arguments provided to a method is not valid. |
OutOfMemoryException | Thrown when failed due to out of memory. |
UnauthorizedAccessException | Thrown when the application does not have proper privileges. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/calendar.read
Feature: http://tizen.org/feature/calendar
View SourceGetChangesByVersion(String, Int32, Int32, out Int32)
Retrieves the records with the given calendar database version.
Declaration
public CalendarList GetChangesByVersion(string viewUri, int BookId, int calendarDBVersion, out int currentDBVersion)
Parameters
Type | Name | Description |
---|---|---|
String | viewUri | The view URI to get records from. |
Int32 | BookId | The calendar book ID to filter. |
Int32 | calendarDBVersion | The calendar database version. |
Int32 | currentDBVersion | The current calendar database version. |
Returns
Type | Description |
---|---|
CalendarList | The record list. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown when the feature is not supported. |
InvalidOperationException | Thrown when the method failed due to an invalid operation. |
ArgumentException | Thrown when one of the arguments provided to a method is not valid. |
OutOfMemoryException | Thrown when failed due to out of memory. |
UnauthorizedAccessException | Thrown when the application does not have proper privileges. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/calendar.read
Feature: http://tizen.org/feature/calendar
View SourceGetCount(String)
Gets the record count of a specific view.
Declaration
public int GetCount(string viewUri)
Parameters
Type | Name | Description |
---|---|---|
String | viewUri | The view URI to get records from. |
Returns
Type | Description |
---|---|
Int32 | The count of records. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/calendar.read
View SourceGetCount(CalendarQuery)
Gets the record count with a query.
Declaration
public int GetCount(CalendarQuery query)
Parameters
Type | Name | Description |
---|---|---|
CalendarQuery | query | The query used for filtering the results. |
Returns
Type | Description |
---|---|
Int32 | The count of records. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/calendar.read
View SourceGetRecordsWithQuery(CalendarQuery, Int32, Int32)
Retrieves the records using a query.
Declaration
public CalendarList GetRecordsWithQuery(CalendarQuery query, int offset, int limit)
Parameters
Type | Name | Description |
---|---|---|
CalendarQuery | query | The query used to filter results. |
Int32 | offset | The index from which results are received. |
Int32 | limit | The maximum number of results (value 0 is used for all the records). |
Returns
Type | Description |
---|---|
CalendarList | CalendarList. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown when the feature is not supported. |
InvalidOperationException | Thrown when the method failed due to an invalid operation. |
OutOfMemoryException | Thrown when failed due to out of memory. |
UnauthorizedAccessException | Thrown when the application does not have proper privileges. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/calendar.read
Feature: http://tizen.org/feature/calendar
View SourceInsert(CalendarList)
Inserts multiple records into the calendar database as a batch operation.
Declaration
public int[] Insert(CalendarList list)
Parameters
Type | Name | Description |
---|---|---|
CalendarList | list | The record list. |
Returns
Type | Description |
---|---|
Int32[] | The inserted record ID array. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown when the feature is not supported. |
InvalidOperationException | Thrown when the method failed due to an invalid operation. |
ArgumentException | Thrown when one of the arguments provided to a method is not valid. |
OutOfMemoryException | Thrown when failed due to out of memory. |
UnauthorizedAccessException | Thrown when the application does not have proper privileges. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/calendar.write
Feature: http://tizen.org/feature/calendar
View SourceInsert(CalendarRecord)
Inserts a record into the calendar database.
Declaration
public int Insert(CalendarRecord record)
Parameters
Type | Name | Description |
---|---|---|
CalendarRecord | record | The record to be inserted. |
Returns
Type | Description |
---|---|
Int32 | The ID of inserted record. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown when the feature is not supported. |
InvalidOperationException | Thrown when the method failed due to an invalid operation. |
ArgumentException | Thrown when one of the arguments provided to a method is not valid. |
OutOfMemoryException | Thrown when failed due to out of memory. |
UnauthorizedAccessException | Thrown when the application does not have proper privileges. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/calendar.write
Feature: http://tizen.org/feature/calendar
View SourceLinkRecord(Int32, Int32)
Links a record to another record.
Declaration
public void LinkRecord(int baseId, int recordId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | baseId | The base record ID. |
Int32 | recordId | The record ID to link to. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown when the feature is not supported. |
InvalidOperationException | Thrown when the method failed due to an invalid operation. |
ArgumentException | Thrown when one of the arguments provided to a method is not valid. |
OutOfMemoryException | Thrown when failed due to out of memory. |
UnauthorizedAccessException | Thrown when the application does not have proper privileges. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/calendar.write
Feature: http://tizen.org/feature/calendar
View SourceRemoveDBChangedDelegate(String, EventHandler<DBChangedEventArgs>)
Deregisters a callback function.
Declaration
public void RemoveDBChangedDelegate(string viewUri, EventHandler<DBChangedEventArgs> DBChanged)
Parameters
Type | Name | Description |
---|---|---|
String | viewUri | The view URI of the record to subscribe for change notifications. |
EventHandler<DBChangedEventArgs> | DBChanged | The EventHandler to deregister. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown when the feature is not supported. |
InvalidOperationException | Thrown when the method failed due to an invalid operation. |
OutOfMemoryException | Thrown when failed due to out of memory. |
UnauthorizedAccessException | Thrown when the application does not have proper privileges. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/calendar.read
Feature: http://tizen.org/feature/calendar
View SourceReplace(CalendarList, Int32[])
Replaces multiple records in the calendar database as a batch operation.
Declaration
public void Replace(CalendarList list, int[] idArray)
Parameters
Type | Name | Description |
---|---|---|
CalendarList | list | The record list. |
Int32[] | idArray | The record IDs. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown when the feature is not supported. |
InvalidOperationException | Thrown when the method failed due to an invalid operation. |
ArgumentException | Thrown when one of the arguments provided to a method is not valid. |
OutOfMemoryException | Thrown when failed due to out of memory. |
UnauthorizedAccessException | Thrown when the application does not have proper privileges. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/calendar.write
Feature: http://tizen.org/feature/calendar
View SourceReplace(CalendarRecord, Int32)
Replaces a record in the calendar database.
Declaration
public void Replace(CalendarRecord record, int id)
Parameters
Type | Name | Description |
---|---|---|
CalendarRecord | record | The record to be replaced. |
Int32 | id | The record ID. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown when the feature is not supported. |
InvalidOperationException | Thrown when the method failed due to an invalid operation. |
ArgumentException | Thrown when one of the arguments provided to a method is not valid. |
OutOfMemoryException | Thrown when failed due to out of memory. |
UnauthorizedAccessException | Thrown when the application does not have proper privileges. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/calendar.write
Feature: http://tizen.org/feature/calendar
View SourceUnlinkRecord(Int32)
Unlinks a record from the base record.
Declaration
public void UnlinkRecord(int recordId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | recordId | The record ID to unlink. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown when the feature is not supported. |
InvalidOperationException | Thrown when the method failed due to an invalid operation. |
ArgumentException | Thrown when one of the arguments provided to a method is not valid. |
OutOfMemoryException | Thrown when failed due to out of memory. |
UnauthorizedAccessException | Thrown when the application does not have proper privileges. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/calendar.write
Feature: http://tizen.org/feature/calendar
View SourceUpdate(CalendarList)
Updates multiple records into the calendar database as a batch operation.
Declaration
public void Update(CalendarList list)
Parameters
Type | Name | Description |
---|---|---|
CalendarList | list | The record list. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown when the feature is not supported. |
InvalidOperationException | Thrown when the method failed due to an invalid operation. |
ArgumentException | Thrown when one of the arguments provided to a method is not valid. |
OutOfMemoryException | Thrown when failed due to out of memory. |
UnauthorizedAccessException | Thrown when the application does not have proper privileges. |
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/calendar.write
Feature: http://tizen.org/feature/calendar
View SourceUpdate(CalendarRecord)
Updates a record in the calendar database.
Declaration
public void Update(CalendarRecord record)
Parameters
Type | Name | Description |
---|---|---|
CalendarRecord | record | The record to be updated. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown when the feature is not supported. |
InvalidOperationException | Thrown when the method failed due to an invalid operation. |
ArgumentException | Thrown when one of the arguments provided to a method is not valid. |
OutOfMemoryException | Thrown when failed due to out of memory. |
UnauthorizedAccessException | Thrown when the application does not have proper privileges. |