From 52c60136bc8c6debfd332046881a5f98c0ccffa4 Mon Sep 17 00:00:00 2001 From: Matt Lacey Date: Mon, 8 Jun 2020 20:46:43 +0100 Subject: [PATCH] remove use of blacklist/whitelist terminology (#2622) --- dev/CommonStyles/APITests/CommonStylesTests.cs | 12 ++++++------ dev/PersonPicture/InitialsGenerator.cpp | 2 +- test/TestAppUtils/VisualTreeDumper.cs | 12 ++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/dev/CommonStyles/APITests/CommonStylesTests.cs b/dev/CommonStyles/APITests/CommonStylesTests.cs index e9eef9e73f..72184a73b5 100644 --- a/dev/CommonStyles/APITests/CommonStylesTests.cs +++ b/dev/CommonStyles/APITests/CommonStylesTests.cs @@ -173,8 +173,8 @@ public void VerifyVisualTreeForCommandBarOverflowMenu() }); var visualTreeDumperFilter = new VisualTreeDumper.DefaultFilter(); - visualTreeDumperFilter.PropertyNameWhiteList.Remove("MaxWidth"); - visualTreeDumperFilter.PropertyNameWhiteList.Remove("MaxHeight"); + visualTreeDumperFilter.PropertyNameAllowedList.Remove("MaxWidth"); + visualTreeDumperFilter.PropertyNameAllowedList.Remove("MaxHeight"); VisualTreeTestHelper.VerifyVisualTree(root: overflowContent, masterFilePrefix: "CommandBarOverflowMenu", filter: visualTreeDumperFilter); } @@ -305,9 +305,9 @@ public void VerifyVisualTreeExampleWithCustomerPropertyValueTranslator() class CustomizedFilter : VisualTreeDumper.IFilter { - private static readonly string[] _propertyNamePostfixBlackList = new string[] { "Property", "Transitions", "Template", "Style", "Selector" }; + private static readonly string[] _propertyNamePostfixBlockList = new string[] { "Property", "Transitions", "Template", "Style", "Selector" }; - private static readonly string[] _propertyNameBlackList = new string[] { "Interactions", "ColumnDefinitions", "RowDefinitions", + private static readonly string[] _propertyNameBlockList = new string[] { "Interactions", "ColumnDefinitions", "RowDefinitions", "Children", "Resources", "Transitions", "Dispatcher", "TemplateSettings", "ContentTemplate", "ContentTransitions", "ContentTemplateSelector", "Content", "ContentTemplateRoot", "XYFocusUp", "XYFocusRight", "XYFocusLeft", "Parent", "Triggers", "RequestedTheme", "XamlRoot", "IsLoaded", "BaseUri", "Resources"}; @@ -394,8 +394,8 @@ public bool ShouldVisitElement(string elementName) public bool ShouldVisitProperty(string propertyName) { - return (_propertyNamePostfixBlackList.Where(item => propertyName.EndsWith(item)).Count()) == 0 && - !_propertyNameBlackList.Contains(propertyName); + return (_propertyNamePostfixBlockList.Where(item => propertyName.EndsWith(item)).Count()) == 0 && + !_propertyNameBlockList.Contains(propertyName); } } diff --git a/dev/PersonPicture/InitialsGenerator.cpp b/dev/PersonPicture/InitialsGenerator.cpp index 875181350a..e794551205 100644 --- a/dev/PersonPicture/InitialsGenerator.cpp +++ b/dev/PersonPicture/InitialsGenerator.cpp @@ -291,7 +291,7 @@ CharacterType InitialsGenerator::GetCharacterType(const wstring_view &str) CharacterType InitialsGenerator::GetCharacterType(wchar_t character) { - // To ensure predictable behavior, we're currently operating on a whitelist of character sets. + // To ensure predictable behavior, we're currently operating on an allowed list of character sets. // // Each block below is a HEX range in the official Unicode spec, which defines a set // of Unicode characters. Changes to the character sets would only be made by Unicode, and diff --git a/test/TestAppUtils/VisualTreeDumper.cs b/test/TestAppUtils/VisualTreeDumper.cs index 583f02c50a..19aef71cf0 100644 --- a/test/TestAppUtils/VisualTreeDumper.cs +++ b/test/TestAppUtils/VisualTreeDumper.cs @@ -141,8 +141,8 @@ private static void WalkThroughTree(DependencyObject node, Visitor visitor) public static readonly string ValueNULL = "[NULL]"; public class DefaultFilter : IFilter { - private static readonly string[] _propertyNamePostfixWhiteList = new string[] {"Brush", "Thickness"}; - private List _propertyNameWhiteList = new List {"Background", "Foreground", "Padding", "Margin", "RenderSize", "Visibility", "Name", "CornerRadius", + private static readonly string[] _propertyNamePostfixAllowedList = new string[] {"Brush", "Thickness"}; + private List _propertyNameAllowedList = new List {"Background", "Foreground", "Padding", "Margin", "RenderSize", "Visibility", "Name", "CornerRadius", "Width", "Height", "MinWidth", "MinHeight", "MaxWidth", "MaxHeight" }; private static readonly Dictionary _ignorePropertyValues = new Dictionary { {"MinWidth","0" }, @@ -151,10 +151,10 @@ public class DefaultFilter : IFilter {"MaxHeight","∞" }, }; - public List PropertyNameWhiteList + public List PropertyNameAllowedList { - get { return _propertyNameWhiteList; } - set { _propertyNameWhiteList = value; } + get { return _propertyNameAllowedList; } + set { _propertyNameAllowedList = value; } } public virtual bool ShouldVisitPropertyValuePair(string propertyName, string value) @@ -175,7 +175,7 @@ public virtual bool ShouldVisitElement(string elementName) public virtual bool ShouldVisitProperty(string propertyName) { - return (_propertyNamePostfixWhiteList.Where(item => propertyName.EndsWith(item)).Count()) > 0 || _propertyNameWhiteList.Contains(propertyName); + return (_propertyNamePostfixAllowedList.Where(item => propertyName.EndsWith(item)).Count()) > 0 || _propertyNameAllowedList.Contains(propertyName); } }