From: Myungki Lee Date: Tue, 11 Apr 2017 05:25:05 +0000 (+0900) Subject: Fix coding style X-Git-Tag: submit/trunk/20170823.075128~119^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ac3b256103f1d0fcf83e22fb3936c400c60fe0e0;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git Fix coding style Change-Id: Ib2e17b6335402cecac03c6958f6fb36f5ac98042 Signed-off-by: Myungki Lee --- diff --git a/src/Tizen.Applications.Badge/Interop/Interop.Badge.cs b/src/Tizen.Applications.Badge/Interop/Interop.Badge.cs index e3dab3f..2de3367 100755 --- a/src/Tizen.Applications.Badge/Interop/Interop.Badge.cs +++ b/src/Tizen.Applications.Badge/Interop/Interop.Badge.cs @@ -46,6 +46,7 @@ internal static partial class Interop } 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")] @@ -74,6 +75,5 @@ internal static partial class Interop [DllImport(Libraries.Badge, EntryPoint = "badge_unregister_changed_cb")] internal static extern ErrorCode UnsetChangedCallback(ChangedCallback callback); - } } diff --git a/src/Tizen.Applications.Badge/Tizen.Applications/BadgeControl.cs b/src/Tizen.Applications.Badge/Tizen.Applications/BadgeControl.cs index c74ec60..3cfd4fe 100755 --- a/src/Tizen.Applications.Badge/Tizen.Applications/BadgeControl.cs +++ b/src/Tizen.Applications.Badge/Tizen.Applications/BadgeControl.cs @@ -20,7 +20,7 @@ using System.Collections.Generic; namespace Tizen.Applications { /// - /// Class for badge operaion. + /// Class for badge operation. /// public static class BadgeControl { @@ -41,7 +41,10 @@ namespace Tizen.Applications 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) @@ -57,6 +60,7 @@ namespace Tizen.Applications } s_registered = true; } + s_changed += value; } remove @@ -77,6 +81,7 @@ namespace Tizen.Applications case Interop.Badge.ErrorCode.NotExist: throw new InvalidOperationException("Not exist"); } + s_callback = null; s_registered = false; } diff --git a/src/Tizen.Applications.Badge/Tizen.Applications/BadgeEventArgs.cs b/src/Tizen.Applications.Badge/Tizen.Applications/BadgeEventArgs.cs index ece8bca..bd36b0a 100755 --- a/src/Tizen.Applications.Badge/Tizen.Applications/BadgeEventArgs.cs +++ b/src/Tizen.Applications.Badge/Tizen.Applications/BadgeEventArgs.cs @@ -23,7 +23,6 @@ namespace Tizen.Applications /// public class BadgeEventArgs : EventArgs { - internal BadgeEventArgs() { }