From 52871eeca6d98062198154b207b9ad9c4fea44f2 Mon Sep 17 00:00:00 2001 From: prashelke Date: Thu, 29 Aug 2024 17:26:07 +0530 Subject: [PATCH 1/2] D41117_AccessiblityRule after Checked Dirty Marking is not trigging is fixed --- Ginger/Ginger/SolutionWindows/AccessibilityRulePage.xaml.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Ginger/Ginger/SolutionWindows/AccessibilityRulePage.xaml.cs b/Ginger/Ginger/SolutionWindows/AccessibilityRulePage.xaml.cs index 9950bbbcce..a75193bf7d 100644 --- a/Ginger/Ginger/SolutionWindows/AccessibilityRulePage.xaml.cs +++ b/Ginger/Ginger/SolutionWindows/AccessibilityRulePage.xaml.cs @@ -119,16 +119,16 @@ private void CheckBox_Click(object sender, RoutedEventArgs e) mAccessibilityConfiguration.ExcludedRules = mAccessibilityConfiguration.ExcludedRules != null ? mAccessibilityConfiguration.ExcludedRules : new(); } - if (!mAccessibilityConfiguration.ExcludedRules.Any(x => x.Equals(data.RuleID))) + if (!mAccessibilityConfiguration.ExcludedRules.Any(x => x.RuleID.Equals(data.RuleID,StringComparison.CurrentCultureIgnoreCase))) { mAccessibilityConfiguration.ExcludedRules.Add(data); } } else { - if (mAccessibilityConfiguration.ExcludedRules.Any(x => x.Equals(data.RuleID))) + if (mAccessibilityConfiguration.ExcludedRules.Any(x => x.RuleID.Equals(data.RuleID,StringComparison.CurrentCultureIgnoreCase))) { - mAccessibilityConfiguration.ExcludedRules.Remove(data); + mAccessibilityConfiguration.ExcludedRules.RemoveItem(data); } } } From 83c5b02372810fe42df0cbc736a13a26bb8dfb6c Mon Sep 17 00:00:00 2001 From: prashelke Date: Thu, 29 Aug 2024 18:18:49 +0530 Subject: [PATCH 2/2] Accessibility Rule Changes --- .../AccessibilityRulePage.xaml.cs | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Ginger/Ginger/SolutionWindows/AccessibilityRulePage.xaml.cs b/Ginger/Ginger/SolutionWindows/AccessibilityRulePage.xaml.cs index a75193bf7d..1224a4d8b4 100644 --- a/Ginger/Ginger/SolutionWindows/AccessibilityRulePage.xaml.cs +++ b/Ginger/Ginger/SolutionWindows/AccessibilityRulePage.xaml.cs @@ -110,15 +110,15 @@ private void CheckBox_Click(object sender, RoutedEventArgs e) // Do something with data, for example: data.Active = checkBox.IsChecked ?? false; mAccessibilityConfiguration.StartDirtyTracking(); - if (!data.Active) + if (!mAccessibilityConfiguration.ExcludedRules.Any()) { - if(!mAccessibilityConfiguration.ExcludedRules.Any()) - { - GingerCoreNET.GeneralLib.General.CreateDefaultAccessiblityconfiguration(); - mAccessibilityConfiguration = WorkSpace.Instance.SolutionRepository.GetFirstRepositoryItem(); - mAccessibilityConfiguration.ExcludedRules = mAccessibilityConfiguration.ExcludedRules != null ? mAccessibilityConfiguration.ExcludedRules : new(); - } + GingerCoreNET.GeneralLib.General.CreateDefaultAccessiblityconfiguration(); + mAccessibilityConfiguration = WorkSpace.Instance.SolutionRepository.GetFirstRepositoryItem(); + mAccessibilityConfiguration.ExcludedRules = mAccessibilityConfiguration.ExcludedRules != null ? mAccessibilityConfiguration.ExcludedRules : new(); + } + if (!data.Active) + { if (!mAccessibilityConfiguration.ExcludedRules.Any(x => x.RuleID.Equals(data.RuleID,StringComparison.CurrentCultureIgnoreCase))) { mAccessibilityConfiguration.ExcludedRules.Add(data); @@ -128,7 +128,12 @@ private void CheckBox_Click(object sender, RoutedEventArgs e) { if (mAccessibilityConfiguration.ExcludedRules.Any(x => x.RuleID.Equals(data.RuleID,StringComparison.CurrentCultureIgnoreCase))) { - mAccessibilityConfiguration.ExcludedRules.RemoveItem(data); + AccessibilityRuleData itemToRemove = mAccessibilityConfiguration.ExcludedRules.FirstOrDefault(x => x.RuleID.Equals(data.RuleID, StringComparison.CurrentCultureIgnoreCase)); + if (itemToRemove != null) + { + mAccessibilityConfiguration.ExcludedRules.Remove(itemToRemove); + } + } } }