From 896ad6c880b4f0803265f25704ff05b23d3dba5e Mon Sep 17 00:00:00 2001 From: jaehyun0cho Date: Tue, 21 Jul 2020 11:20:22 +0900 Subject: [PATCH] [NUI] Add public types to replace nested types of Components.Switch (#1809) To replace nested types (CA1034 of StyleCop), the following is added. - event EventHandler in Switch class The followings are deprecated. - class SelectEventArgs in Switch class - event EventHandler in Switch class Co-authored-by: Jaehyun Cho --- src/Tizen.NUI.Components/Controls/Switch.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Tizen.NUI.Components/Controls/Switch.cs b/src/Tizen.NUI.Components/Controls/Switch.cs index f658e40..0d668dd 100755 --- a/src/Tizen.NUI.Components/Controls/Switch.cs +++ b/src/Tizen.NUI.Components/Controls/Switch.cs @@ -66,9 +66,16 @@ namespace Tizen.NUI.Components /// An event for the item selected signal which can be used to subscribe or unsubscribe the event handler provided by the user.
/// /// 6 + [Obsolete("Deprecated in API8; Will be removed in API10. Please use SelectedChanged event instead.")] public event EventHandler SelectedEvent; /// + /// An event for the item selected signal which can be used to subscribe or unsubscribe the event handler provided by the user. + /// + /// 8 + public event EventHandler SelectedChanged; + + /// /// Return a copied Style instance of Switch /// /// @@ -334,12 +341,20 @@ namespace Tizen.NUI.Components eventArgs.IsSelected = IsSelected; SelectedEvent(this, eventArgs); } + + if (SelectedChanged != null) + { + SelectedChangedEventArgs eventArgs = new SelectedChangedEventArgs(); + eventArgs.IsSelected = IsSelected; + SelectedChanged(this, eventArgs); + } } /// /// SelectEventArgs is a class to record item selected arguments which will sent to user. /// /// 6 + [Obsolete("Deprecated in API8; Will be removed in API10. Please use SelectedChangedEventArgs instead.")] public class SelectEventArgs : EventArgs { /// Select state of Switch -- 2.7.4