From c183a7daed2933b8c767c26441618bf56bd43518 Mon Sep 17 00:00:00 2001 From: Jaehyun Cho <29364140+jaehyun0cho@users.noreply.github.com> Date: Fri, 12 Mar 2021 10:44:10 +0900 Subject: [PATCH] [NUI] Remove CA2000 false alarm in Navigator (#2729) Since the pushed views are added to NavigationPages and are disposed in Navigator.Dispose(), the CA2000 in Navigator is false alarm. To remove the CA2000 false alarm, SuppressMessage for CA2000 is added. Co-authored-by: Jaehyun Cho --- src/Tizen.NUI.Components/Controls/Navigation/Navigator.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Tizen.NUI.Components/Controls/Navigation/Navigator.cs b/src/Tizen.NUI.Components/Controls/Navigation/Navigator.cs index 10f371c..b79addc 100755 --- a/src/Tizen.NUI.Components/Controls/Navigation/Navigator.cs +++ b/src/Tizen.NUI.Components/Controls/Navigation/Navigator.cs @@ -18,6 +18,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; using System.Threading.Tasks; using Tizen.NUI.BaseComponents; using Tizen.NUI.Binding; @@ -377,6 +378,9 @@ namespace Tizen.NUI.Components /// /// The content of Dialog. [EditorBrowsable(EditorBrowsableState.Never)] + [SuppressMessage("Microsoft.Reliability", + "CA2000:DisposeObjectsBeforeLosingScope", + Justification = "The pushed views are added to NavigationPages and are disposed in Navigator.Dispose().")] public static void ShowDialog(View content = null) { var window = NUIApplication.GetDefaultWindow(); @@ -397,6 +401,9 @@ namespace Tizen.NUI.Components /// The content of AlertDialog. /// The action content of AlertDialog. [EditorBrowsable(EditorBrowsableState.Never)] + [SuppressMessage("Microsoft.Reliability", + "CA2000:DisposeObjectsBeforeLosingScope", + Justification = "The pushed views are added to NavigationPages and are disposed in Navigator.Dispose().")] public static void ShowAlertDialog(View titleContent, View content, View actionContent) { var window = NUIApplication.GetDefaultWindow(); @@ -420,6 +427,9 @@ namespace Tizen.NUI.Components /// The negative button text in the action content of AlertDialog. /// The clicked callback of the negative button in the action content of AlertDialog. [EditorBrowsable(EditorBrowsableState.Never)] + [SuppressMessage("Microsoft.Reliability", + "CA2000:DisposeObjectsBeforeLosingScope", + Justification = "The pushed views are added to NavigationPages and are disposed in Navigator.Dispose().")] public static void ShowAlertDialog(string title = null, string message = null, string positiveButtonText = null, EventHandler positiveButtonClickedHandler = null, string negativeButtonText = null, EventHandler negativeButtonClickedHandler = null) { var window = NUIApplication.GetDefaultWindow(); -- 2.7.4