From ab8f17ef987fd63100bfd4dc1eb59414b60da841 Mon Sep 17 00:00:00 2001 From: Seoyeon Kim Date: Mon, 18 Jan 2021 18:35:49 +0900 Subject: [PATCH] [NUI] Fix AccessibilityManager Event handler - Changed the old-fashioned code of event handler Signed-off-by: Seoyeon Kim --- .../Accessibility/AccessibilityManagerEvent.cs | 276 ++++++++++----------- 1 file changed, 137 insertions(+), 139 deletions(-) diff --git a/src/Tizen.NUI/src/public/Accessibility/AccessibilityManagerEvent.cs b/src/Tizen.NUI/src/public/Accessibility/AccessibilityManagerEvent.cs index a72a45b..462e3d2 100755 --- a/src/Tizen.NUI/src/public/Accessibility/AccessibilityManagerEvent.cs +++ b/src/Tizen.NUI/src/public/Accessibility/AccessibilityManagerEvent.cs @@ -187,23 +187,22 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerStatusChangedEventHandler == null) { - _accessibilityManagerStatusChangedEventHandler += value; - _accessibilityManagerStatusChangedEventCallbackDelegate = new StatusChangedEventCallbackDelegate(OnStatusChanged); this.StatusChangedSignal().Connect(_accessibilityManagerStatusChangedEventCallbackDelegate); } + + _accessibilityManagerStatusChangedEventHandler += value; } remove { + _accessibilityManagerStatusChangedEventHandler -= value; - if (_accessibilityManagerStatusChangedEventHandler != null) + if (_accessibilityManagerStatusChangedEventHandler == null && StatusChangedSignal().Empty() == false) { this.StatusChangedSignal().Disconnect(_accessibilityManagerStatusChangedEventCallbackDelegate); } - _accessibilityManagerStatusChangedEventHandler -= value; - } } @@ -221,21 +220,21 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerActionNextEventHandler == null) { - _accessibilityManagerActionNextEventHandler += value; - _accessibilityManagerActionNextEventCallbackDelegate = new ActionNextEventCallbackDelegate(OnActionNext); this.ActionNextSignal().Connect(_accessibilityManagerActionNextEventCallbackDelegate); } + + _accessibilityManagerActionNextEventHandler += value; } remove { - if (_accessibilityManagerActionNextEventHandler != null) + _accessibilityManagerActionNextEventHandler -= value; + + if (_accessibilityManagerActionNextEventHandler == null && ActionNextSignal().Empty() == false) { this.ActionNextSignal().Disconnect(_accessibilityManagerActionNextEventCallbackDelegate); } - - _accessibilityManagerActionNextEventHandler -= value; } } @@ -253,21 +252,21 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerActionPreviousEventHandler == null) { - _accessibilityManagerActionPreviousEventHandler += value; - _accessibilityManagerActionPreviousEventCallbackDelegate = new ActionPreviousEventCallbackDelegate(OnActionPrevious); this.ActionPreviousSignal().Connect(_accessibilityManagerActionPreviousEventCallbackDelegate); } + + _accessibilityManagerActionPreviousEventHandler += value; } remove { - if (_accessibilityManagerActionPreviousEventHandler != null) + _accessibilityManagerActionPreviousEventHandler -= value; + + if (_accessibilityManagerActionPreviousEventHandler == null && ActionPreviousSignal().Empty() == false) { this.ActionPreviousSignal().Disconnect(_accessibilityManagerActionPreviousEventCallbackDelegate); } - - _accessibilityManagerActionPreviousEventHandler -= value; } } @@ -285,21 +284,21 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerActionActivateEventHandler == null) { - _accessibilityManagerActionActivateEventHandler += value; - _accessibilityManagerActionActivateEventCallbackDelegate = new ActionActivateEventCallbackDelegate(OnActionActivate); this.ActionActivateSignal().Connect(_accessibilityManagerActionActivateEventCallbackDelegate); } + + _accessibilityManagerActionActivateEventHandler += value; } remove { - if (_accessibilityManagerActionActivateEventHandler != null) + _accessibilityManagerActionActivateEventHandler -= value; + + if (_accessibilityManagerActionActivateEventHandler == null && ActionActivateSignal().Empty() == false) { this.ActionActivateSignal().Disconnect(_accessibilityManagerActionActivateEventCallbackDelegate); } - - _accessibilityManagerActionActivateEventHandler -= value; } } @@ -317,21 +316,21 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerActionReadEventHandler == null) { - _accessibilityManagerActionReadEventHandler += value; - _accessibilityManagerActionReadEventCallbackDelegate = new ActionReadEventCallbackDelegate(OnActionRead); this.ActionReadSignal().Connect(_accessibilityManagerActionReadEventCallbackDelegate); } + + _accessibilityManagerActionReadEventHandler += value; } remove { - if (_accessibilityManagerActionReadEventHandler != null) + _accessibilityManagerActionReadEventHandler -= value; + + if (_accessibilityManagerActionReadEventHandler == null && ActionReadSignal().Empty() == false) { this.ActionReadSignal().Disconnect(_accessibilityManagerActionReadEventCallbackDelegate); } - - _accessibilityManagerActionReadEventHandler -= value; } } @@ -349,21 +348,22 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerActionOverEventHandler == null) { - _accessibilityManagerActionOverEventHandler += value; - _accessibilityManagerActionOverEventCallbackDelegate = new ActionOverEventCallbackDelegate(OnActionOver); this.ActionOverSignal().Connect(_accessibilityManagerActionOverEventCallbackDelegate); } + + _accessibilityManagerActionOverEventHandler += value; } remove { - if (_accessibilityManagerActionOverEventHandler != null) + _accessibilityManagerActionOverEventHandler -= value; + + if (_accessibilityManagerActionOverEventHandler == null && ActionOverSignal().Empty() == false) { this.ActionOverSignal().Disconnect(_accessibilityManagerActionOverEventCallbackDelegate); } - _accessibilityManagerActionOverEventHandler -= value; } } @@ -381,21 +381,21 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerActionReadNextEventHandler == null) { - _accessibilityManagerActionReadNextEventHandler += value; - _accessibilityManagerActionReadNextEventCallbackDelegate = new ActionReadNextEventCallbackDelegate(OnActionReadNext); this.ActionReadNextSignal().Connect(_accessibilityManagerActionReadNextEventCallbackDelegate); } + + _accessibilityManagerActionReadNextEventHandler += value; } remove { - if (_accessibilityManagerActionReadNextEventHandler != null) + _accessibilityManagerActionReadNextEventHandler -= value; + + if (_accessibilityManagerActionReadNextEventHandler == null && ActionReadNextSignal().Empty() == false) { this.ActionReadNextSignal().Disconnect(_accessibilityManagerActionReadNextEventCallbackDelegate); } - - _accessibilityManagerActionReadNextEventHandler -= value; } } @@ -413,21 +413,21 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerActionReadPreviousEventHandler == null) { - _accessibilityManagerActionReadPreviousEventHandler += value; - _accessibilityManagerActionReadPreviousEventCallbackDelegate = new ActionReadPreviousEventCallbackDelegate(OnActionReadPrevious); this.ActionReadPreviousSignal().Connect(_accessibilityManagerActionReadPreviousEventCallbackDelegate); } + + _accessibilityManagerActionReadPreviousEventHandler += value; } remove { - if (_accessibilityManagerActionReadPreviousEventHandler != null) + _accessibilityManagerActionReadPreviousEventHandler -= value; + + if (_accessibilityManagerActionReadPreviousEventHandler == null && ActionReadPreviousSignal().Empty() == false) { this.ActionReadPreviousSignal().Disconnect(_accessibilityManagerActionReadPreviousEventCallbackDelegate); } - - _accessibilityManagerActionReadPreviousEventHandler -= value; } } @@ -446,21 +446,21 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerActionUpEventHandler == null) { - _accessibilityManagerActionUpEventHandler += value; - _accessibilityManagerActionUpEventCallbackDelegate = new ActionUpEventCallbackDelegate(OnActionUp); this.ActionUpSignal().Connect(_accessibilityManagerActionUpEventCallbackDelegate); } + + _accessibilityManagerActionUpEventHandler += value; } remove { - if (_accessibilityManagerActionUpEventHandler != null) + _accessibilityManagerActionUpEventHandler -= value; + + if (_accessibilityManagerActionUpEventHandler == null && ActionUpSignal().Empty() == false) { this.ActionUpSignal().Disconnect(_accessibilityManagerActionUpEventCallbackDelegate); } - - _accessibilityManagerActionUpEventHandler -= value; } } @@ -479,21 +479,21 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerActionDownEventHandler == null) { - _accessibilityManagerActionDownEventHandler += value; - _accessibilityManagerActionDownEventCallbackDelegate = new ActionDownEventCallbackDelegate(OnActionDown); this.ActionDownSignal().Connect(_accessibilityManagerActionDownEventCallbackDelegate); } + + _accessibilityManagerActionDownEventHandler += value; } remove { - if (_accessibilityManagerActionDownEventHandler != null) + _accessibilityManagerActionDownEventHandler -= value; + + if (_accessibilityManagerActionDownEventHandler == null && ActionDownSignal().Empty() == false) { this.ActionDownSignal().Disconnect(_accessibilityManagerActionDownEventCallbackDelegate); } - - _accessibilityManagerActionDownEventHandler -= value; } } @@ -512,21 +512,21 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerActionClearFocusEventHandler == null) { - _accessibilityManagerActionClearFocusEventHandler += value; - _accessibilityManagerActionClearFocusEventCallbackDelegate = new ActionClearFocusEventCallbackDelegate(OnActionClearFocus); this.ActionClearFocusSignal().Connect(_accessibilityManagerActionClearFocusEventCallbackDelegate); } + + _accessibilityManagerActionClearFocusEventHandler += value; } remove { - if (_accessibilityManagerActionClearFocusEventHandler != null) + _accessibilityManagerActionClearFocusEventHandler -= value; + + if (_accessibilityManagerActionClearFocusEventHandler == null && ActionClearFocusSignal().Empty() == false) { this.ActionClearFocusSignal().Disconnect(_accessibilityManagerActionClearFocusEventCallbackDelegate); } - - _accessibilityManagerActionClearFocusEventHandler -= value; } } @@ -544,22 +544,21 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerActionBackEventHandler == null) { - _accessibilityManagerActionBackEventHandler += value; - _accessibilityManagerActionBackEventCallbackDelegate = new ActionBackEventCallbackDelegate(OnActionBack); this.ActionBackSignal().Connect(_accessibilityManagerActionBackEventCallbackDelegate); } + + _accessibilityManagerActionBackEventHandler += value; } remove { + _accessibilityManagerActionBackEventHandler -= value; - if (_accessibilityManagerActionBackEventHandler != null) + if (_accessibilityManagerActionBackEventHandler == null && ActionBackSignal().Empty() == false) { this.ActionBackSignal().Disconnect(_accessibilityManagerActionBackEventCallbackDelegate); } - - _accessibilityManagerActionBackEventHandler -= value; } } @@ -577,21 +576,21 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerActionScrollUpEventHandler == null) { - _accessibilityManagerActionScrollUpEventHandler += value; - _accessibilityManagerActionScrollUpEventCallbackDelegate = new ActionScrollUpEventCallbackDelegate(OnActionScrollUp); this.ActionScrollUpSignal().Connect(_accessibilityManagerActionScrollUpEventCallbackDelegate); } + + _accessibilityManagerActionScrollUpEventHandler += value; } remove { - if (_accessibilityManagerActionScrollUpEventHandler != null) + _accessibilityManagerActionScrollUpEventHandler -= value; + + if (_accessibilityManagerActionScrollUpEventHandler == null && ActionScrollUpSignal().Empty() == false) { this.ActionScrollUpSignal().Disconnect(_accessibilityManagerActionScrollUpEventCallbackDelegate); } - - _accessibilityManagerActionScrollUpEventHandler -= value; } } @@ -609,22 +608,21 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerActionScrollDownEventHandler == null) { - _accessibilityManagerActionScrollDownEventHandler += value; - _accessibilityManagerActionScrollDownEventCallbackDelegate = new ActionScrollDownEventCallbackDelegate(OnActionScrollDown); this.ActionScrollDownSignal().Connect(_accessibilityManagerActionScrollDownEventCallbackDelegate); } + + _accessibilityManagerActionScrollDownEventHandler += value; } remove { + _accessibilityManagerActionScrollDownEventHandler -= value; - if (_accessibilityManagerActionScrollDownEventHandler != null) + if (_accessibilityManagerActionScrollDownEventHandler == null && ActionScrollDownSignal().Empty() == false) { this.ActionScrollDownSignal().Disconnect(_accessibilityManagerActionScrollDownEventCallbackDelegate); } - - _accessibilityManagerActionScrollDownEventHandler -= value; } } @@ -642,21 +640,21 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerActionPageLeftEventHandler == null) { - _accessibilityManagerActionPageLeftEventHandler += value; - _accessibilityManagerActionPageLeftEventCallbackDelegate = new ActionPageLeftEventCallbackDelegate(OnActionPageLeft); this.ActionPageLeftSignal().Connect(_accessibilityManagerActionPageLeftEventCallbackDelegate); } + + _accessibilityManagerActionPageLeftEventHandler += value; } remove { - if (_accessibilityManagerActionPageLeftEventHandler != null) + _accessibilityManagerActionPageLeftEventHandler -= value; + + if (_accessibilityManagerActionPageLeftEventHandler == null && ActionPageLeftSignal().Empty() == false) { this.ActionPageLeftSignal().Disconnect(_accessibilityManagerActionPageLeftEventCallbackDelegate); } - - _accessibilityManagerActionPageLeftEventHandler -= value; } } @@ -674,21 +672,21 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerActionPageRightEventHandler == null) { - _accessibilityManagerActionPageRightEventHandler += value; - _accessibilityManagerActionPageRightEventCallbackDelegate = new ActionPageRightEventCallbackDelegate(OnActionPageRight); this.ActionPageRightSignal().Connect(_accessibilityManagerActionPageRightEventCallbackDelegate); } + + _accessibilityManagerActionPageRightEventHandler += value; } remove { - if (_accessibilityManagerActionPageRightEventHandler != null) + _accessibilityManagerActionPageRightEventHandler -= value; + + if (_accessibilityManagerActionPageRightEventHandler == null && ActionPageRightSignal().Empty() == false) { this.ActionPageRightSignal().Disconnect(_accessibilityManagerActionPageRightEventCallbackDelegate); } - - _accessibilityManagerActionPageRightEventHandler -= value; } } @@ -706,21 +704,21 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerActionPageUpEventHandler == null) { - _accessibilityManagerActionPageUpEventHandler += value; - _accessibilityManagerActionPageUpEventCallbackDelegate = new ActionPageUpEventCallbackDelegate(OnActionPageUp); this.ActionPageUpSignal().Connect(_accessibilityManagerActionPageUpEventCallbackDelegate); } + + _accessibilityManagerActionPageUpEventHandler += value; } remove { - if (_accessibilityManagerActionPageUpEventHandler != null) + _accessibilityManagerActionPageUpEventHandler -= value; + + if (_accessibilityManagerActionPageUpEventHandler == null && ActionPageUpSignal().Empty() == false) { this.ActionPageUpSignal().Disconnect(_accessibilityManagerActionPageUpEventCallbackDelegate); } - - _accessibilityManagerActionPageUpEventHandler -= value; } } @@ -738,21 +736,21 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerActionPageDownEventHandler == null) { - _accessibilityManagerActionPageDownEventHandler += value; - _accessibilityManagerActionPageDownEventCallbackDelegate = new ActionPageDownEventCallbackDelegate(OnActionPageDown); this.ActionPageDownSignal().Connect(_accessibilityManagerActionPageDownEventCallbackDelegate); } + + _accessibilityManagerActionPageDownEventHandler += value; } remove { - if (_accessibilityManagerActionPageDownEventHandler != null) + _accessibilityManagerActionPageDownEventHandler -= value; + + if (_accessibilityManagerActionPageDownEventHandler == null && ActionPageDownSignal().Empty() == false) { this.ActionPageDownSignal().Disconnect(_accessibilityManagerActionPageDownEventCallbackDelegate); } - - _accessibilityManagerActionPageDownEventHandler -= value; } } @@ -771,21 +769,21 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerActionMoveToFirstEventHandler == null) { - _accessibilityManagerActionMoveToFirstEventHandler += value; - _accessibilityManagerActionMoveToFirstEventCallbackDelegate = new ActionMoveToFirstEventCallbackDelegate(OnActionMoveToFirst); this.ActionMoveToFirstSignal().Connect(_accessibilityManagerActionMoveToFirstEventCallbackDelegate); } + + _accessibilityManagerActionMoveToFirstEventHandler += value; } remove { - if (_accessibilityManagerActionMoveToFirstEventHandler != null) + _accessibilityManagerActionMoveToFirstEventHandler -= value; + + if (_accessibilityManagerActionMoveToFirstEventHandler == null && ActionMoveToFirstSignal().Empty() == false) { this.ActionMoveToFirstSignal().Disconnect(_accessibilityManagerActionMoveToFirstEventCallbackDelegate); } - - _accessibilityManagerActionMoveToFirstEventHandler -= value; } } @@ -804,21 +802,21 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerActionMoveToLastEventHandler == null) { - _accessibilityManagerActionMoveToLastEventHandler += value; - _accessibilityManagerActionMoveToLastEventCallbackDelegate = new ActionMoveToLastEventCallbackDelegate(OnActionMoveToLast); this.ActionMoveToLastSignal().Connect(_accessibilityManagerActionMoveToLastEventCallbackDelegate); } + + _accessibilityManagerActionMoveToLastEventHandler += value; } remove { - if (_accessibilityManagerActionMoveToLastEventHandler != null) + _accessibilityManagerActionMoveToLastEventHandler -= value; + + if (_accessibilityManagerActionMoveToLastEventHandler == null && ActionMoveToLastSignal().Empty() == false) { this.ActionMoveToLastSignal().Disconnect(_accessibilityManagerActionMoveToLastEventCallbackDelegate); } - - _accessibilityManagerActionMoveToLastEventHandler -= value; } } @@ -837,21 +835,21 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerActionReadFromTopEventHandler == null) { - _accessibilityManagerActionReadFromTopEventHandler += value; - _accessibilityManagerActionReadFromTopEventCallbackDelegate = new ActionReadFromTopEventCallbackDelegate(OnActionReadFromTop); this.ActionReadFromTopSignal().Connect(_accessibilityManagerActionReadFromTopEventCallbackDelegate); } + + _accessibilityManagerActionReadFromTopEventHandler += value; } remove { - if (_accessibilityManagerActionReadFromTopEventHandler != null) + _accessibilityManagerActionReadFromTopEventHandler -= value; + + if (_accessibilityManagerActionReadFromTopEventHandler == null && ActionReadFromTopSignal().Empty() == false) { this.ActionReadFromTopSignal().Disconnect(_accessibilityManagerActionReadFromTopEventCallbackDelegate); } - - _accessibilityManagerActionReadFromTopEventHandler -= value; } } @@ -870,21 +868,21 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerActionReadFromNextEventHandler == null) { - _accessibilityManagerActionReadFromNextEventHandler += value; - _accessibilityManagerActionReadFromNextEventCallbackDelegate = new ActionReadFromNextEventCallbackDelegate(OnActionReadFromNext); this.ActionReadFromNextSignal().Connect(_accessibilityManagerActionReadFromNextEventCallbackDelegate); } + + _accessibilityManagerActionReadFromNextEventHandler += value; } remove { - if (_accessibilityManagerActionReadFromNextEventHandler != null) + _accessibilityManagerActionReadFromNextEventHandler -= value; + + if (_accessibilityManagerActionReadFromNextEventHandler == null && ActionReadFromNextSignal().Empty() == false) { this.ActionReadFromNextSignal().Disconnect(_accessibilityManagerActionReadFromNextEventCallbackDelegate); } - - _accessibilityManagerActionReadFromNextEventHandler -= value; } } @@ -902,21 +900,21 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerActionZoomEventHandler == null) { - _accessibilityManagerActionZoomEventHandler += value; - _accessibilityManagerActionZoomEventCallbackDelegate = new ActionZoomEventCallbackDelegate(OnActionZoom); this.ActionZoomSignal().Connect(_accessibilityManagerActionZoomEventCallbackDelegate); } + + _accessibilityManagerActionZoomEventHandler += value; } remove { - if (_accessibilityManagerActionZoomEventHandler != null) + _accessibilityManagerActionZoomEventHandler -= value; + + if (_accessibilityManagerActionZoomEventHandler == null && ActionZoomSignal().Empty() == false) { this.ActionZoomSignal().Disconnect(_accessibilityManagerActionZoomEventCallbackDelegate); } - - _accessibilityManagerActionZoomEventHandler -= value; } } @@ -934,21 +932,21 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerActionReadPauseResumeEventHandler == null) { - _accessibilityManagerActionReadPauseResumeEventHandler += value; - _accessibilityManagerActionReadPauseResumeEventCallbackDelegate = new ActionReadPauseResumeEventCallbackDelegate(OnActionReadPauseResume); this.ActionReadPauseResumeSignal().Connect(_accessibilityManagerActionReadPauseResumeEventCallbackDelegate); } + + _accessibilityManagerActionReadPauseResumeEventHandler += value; } remove { - if (_accessibilityManagerActionReadPauseResumeEventHandler != null) + _accessibilityManagerActionReadPauseResumeEventHandler -= value; + + if (_accessibilityManagerActionReadPauseResumeEventHandler == null && ActionReadPauseResumeSignal().Empty() == false) { this.ActionReadPauseResumeSignal().Disconnect(_accessibilityManagerActionReadPauseResumeEventCallbackDelegate); } - - _accessibilityManagerActionReadPauseResumeEventHandler -= value; } } @@ -966,21 +964,21 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerActionStartStopEventHandler == null) { - _accessibilityManagerActionStartStopEventHandler += value; - _accessibilityManagerActionStartStopEventCallbackDelegate = new ActionStartStopEventCallbackDelegate(OnActionStartStop); this.ActionStartStopSignal().Connect(_accessibilityManagerActionStartStopEventCallbackDelegate); } + + _accessibilityManagerActionStartStopEventHandler += value; } remove { - if (_accessibilityManagerActionStartStopEventHandler != null) + _accessibilityManagerActionStartStopEventHandler -= value; + + if (_accessibilityManagerActionStartStopEventHandler == null && ActionStartStopSignal().Empty() == false) { this.ActionStartStopSignal().Disconnect(_accessibilityManagerActionStartStopEventCallbackDelegate); } - - _accessibilityManagerActionStartStopEventHandler -= value; } } @@ -1051,21 +1049,21 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerFocusChangedEventHandler == null) { - _accessibilityManagerFocusChangedEventHandler += value; - _accessibilityManagerFocusChangedEventCallbackDelegate = new FocusChangedEventCallbackDelegate(OnFocusChanged); this.FocusChangedSignal().Connect(_accessibilityManagerFocusChangedEventCallbackDelegate); } + + _accessibilityManagerFocusChangedEventHandler += value; } remove { - if (_accessibilityManagerFocusChangedEventHandler != null) + _accessibilityManagerFocusChangedEventHandler -= value; + + if (_accessibilityManagerFocusChangedEventHandler == null && FocusChangedSignal().Empty() == false) { this.FocusChangedSignal().Disconnect(_accessibilityManagerFocusChangedEventCallbackDelegate); } - - _accessibilityManagerFocusChangedEventHandler -= value; } } @@ -1083,21 +1081,21 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerFocusedViewActivatedEventHandler == null) { - _accessibilityManagerFocusedViewActivatedEventHandler += value; - _accessibilityManagerFocusedViewActivatedEventCallbackDelegate = new FocusedViewActivatedEventCallbackDelegate(OnFocusedViewActivated); this.FocusedViewActivatedSignal().Connect(_accessibilityManagerFocusedViewActivatedEventCallbackDelegate); } + + _accessibilityManagerFocusedViewActivatedEventHandler += value; } remove { - if (_accessibilityManagerFocusedViewActivatedEventHandler != null) + _accessibilityManagerFocusedViewActivatedEventHandler -= value; + + if (_accessibilityManagerFocusedViewActivatedEventHandler == null && FocusedViewActivatedSignal().Empty() == false) { this.FocusedViewActivatedSignal().Disconnect(_accessibilityManagerFocusedViewActivatedEventCallbackDelegate); } - - _accessibilityManagerFocusedViewActivatedEventHandler -= value; } } @@ -1115,21 +1113,21 @@ namespace Tizen.NUI.Accessibility // Restricted to only one listener if (_accessibilityManagerFocusOvershotEventHandler == null) { - _accessibilityManagerFocusOvershotEventHandler += value; - _accessibilityManagerFocusOvershotEventCallbackDelegate = new FocusOvershotEventCallbackDelegate(OnFocusOvershot); this.FocusOvershotSignal().Connect(_accessibilityManagerFocusOvershotEventCallbackDelegate); } + + _accessibilityManagerFocusOvershotEventHandler += value; } remove { - if (_accessibilityManagerFocusOvershotEventHandler != null) + _accessibilityManagerFocusOvershotEventHandler -= value; + + if (_accessibilityManagerFocusOvershotEventHandler == null && FocusOvershotSignal().Empty() == false) { this.FocusOvershotSignal().Disconnect(_accessibilityManagerFocusOvershotEventCallbackDelegate); } - - _accessibilityManagerFocusOvershotEventHandler -= value; } } } -- 2.7.4