}
internal delegate void ForeachCallback(string appId, uint count, IntPtr userData);
+
internal delegate void ChangedCallback(Action action, string appId, uint count, IntPtr userData);
[DllImport(Libraries.Badge, EntryPoint = "badge_add")]
[DllImport(Libraries.Badge, EntryPoint = "badge_unregister_changed_cb")]
internal static extern ErrorCode UnsetChangedCallback(ChangedCallback callback);
-
}
}
namespace Tizen.Applications
{
/// <summary>
- /// Class for badge operaion.
+ /// Class for badge operation.
/// </summary>
public static class BadgeControl
{
if (s_changed == null && !s_registered)
{
if (s_callback == null)
+ {
s_callback = new Interop.Badge.ChangedCallback(OnChangedEvent);
+ }
+
Interop.Badge.ErrorCode err = Interop.Badge.SetChangedCallback(s_callback, IntPtr.Zero);
switch (err)
}
s_registered = true;
}
+
s_changed += value;
}
remove
case Interop.Badge.ErrorCode.NotExist:
throw new InvalidOperationException("Not exist");
}
+
s_callback = null;
s_registered = false;
}