{
using System;
using System.Collections.Generic;
+ using Tizen.Internals.Errors;
/// <summary>
/// The callback function that is invoked when add request occurred
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <param name="addedEvent">The callback function pointer that is invoked when Add() is requested</param>
- /// <feature>http://tizen.org/feature/shortcut </feature>
+ /// <feature>http://tizen.org/feature/shortcut</feature>
/// <privilege>http://tizen.org/privilege/shortcut</privilege>
/// <remarks>
/// Previous registered delegate function should be unregister.
/// </remarks>
/// <exception cref="ArgumentException">Thrown when argument is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
- /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
/// <exception cref="NotSupportedException">Thrown when Shortcut is not supported.</exception>
+ /// <exception cref="OutOfMemoryException">Thrown in case of out of memory.</exception>
+ /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
public static void RegisterEventHandler(ShortcutAdded addedEvent)
{
shortcutAdded = addedEvent;
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <param name="deletedEvent">The callback function pointer that is invoked when Delete() is requested</param>
- /// <feature>http://tizen.org/feature/shortcut </feature>
+ /// <feature>http://tizen.org/feature/shortcut</feature>
/// <privilege>http://tizen.org/privilege/shortcut</privilege>
/// <remarks>
/// Previous registered delegate function should be unregister.
/// </remarks>
/// <exception cref="ArgumentException">Thrown when argument is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
- /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
/// <exception cref="NotSupportedException">Thrown when Shortcut is not supported.</exception>
+ /// <exception cref="OutOfMemoryException">Thrown in case of out of memory.</exception>
+ /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
public static void RegisterEventHandler(ShortcutDeleted deletedEvent)
{
shortcutDeleted = deletedEvent;
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <param name="addedEvent">The callback function pointer that used for RegisterCallback</param>
- /// <feature>http://tizen.org/feature/shortcut </feature>
+ /// <feature>http://tizen.org/feature/shortcut</feature>
/// <privilege>http://tizen.org/privilege/shortcut</privilege>
/// <exception cref="ArgumentException">Thrown when argument is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
- /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
/// <exception cref="NotSupportedException">Thrown when Shortcut is not supported.</exception>
public static void UnregisterEventHandler(ShortcutAdded addedEvent)
{
{
Interop.Shortcut.UnsetShortcutAddCallback();
shortcutAddCallback = null;
+
+ int err = ErrorFacts.GetLastResult();
+ if (err != (int)Interop.Shortcut.ErrorCode.None)
+ {
+ throw ShortcutErrorFactory.GetException((Interop.Shortcut.ErrorCode)err, "unable to unregister callback");
+ }
}
}
else
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <param name="deletedEvent">The callback function pointer that used for RegisterCallback</param>
- /// <feature>http://tizen.org/feature/shortcut </feature>
+ /// <feature>http://tizen.org/feature/shortcut</feature>
/// <privilege>http://tizen.org/privilege/shortcut</privilege>
/// <exception cref="ArgumentException">Thrown when argument is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
- /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
/// <exception cref="NotSupportedException">Thrown when Shortcut is not supported.</exception>
public static void UnregisterEventHandler(ShortcutDeleted deletedEvent)
{
if (shortcutDeleteCallback != null)
{
+
Interop.Shortcut.UnsetShortcutDeleteCallback();
shortcutDeleteCallback = null;
+
+ int err = ErrorFacts.GetLastResult();
+ if (err != (int)Interop.Shortcut.ErrorCode.None)
+ {
+ throw ShortcutErrorFactory.GetException((Interop.Shortcut.ErrorCode) err, "unable to unregister callback");
+ }
}
}
else
/// <since_tizen> 3 </since_tizen>
/// <param name="appId">Application ID.</param>
/// <returns>The List of ShortcutTemplate.</returns>
- /// <feature>http://tizen.org/feature/shortcut </feature>
+ /// <feature>http://tizen.org/feature/shortcut</feature>
/// <privilege>http://tizen.org/privilege/shortcut</privilege>
/// <exception cref="ArgumentException">Thrown when argument is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
- /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
/// <exception cref="NotSupportedException">Thrown when Shortcut is not supported.</exception>
+ /// <exception cref="OutOfMemoryException">Thrown in case of out of memory.</exception>
+ /// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
public static IEnumerable<ShortcutTemplate> GetTemplateList(string appId)
{
shortcutTemplates.Clear();