From 7f4222997b30c00fb5da6720a13bd90c8bdb5744 Mon Sep 17 00:00:00 2001 From: grokys Date: Fri, 12 Mar 2021 15:24:56 +0100 Subject: [PATCH] Don't use C#9 features. Causing the build to fail on OSX/Linux --- .../Automation/AutomationElementIdentifiers.cs | 6 +++--- .../Automation/ExpandCollapsePatternIdentifiers.cs | 2 +- .../Automation/RangeValuePatternIdentifiers.cs | 8 ++++---- .../Automation/ScrollPatternIdentifiers.cs | 12 ++++++------ .../Automation/SelectionPatternIdentifiers.cs | 6 +++--- .../Avalonia.Win32/Automation/AutomationNode.cs | 4 ++-- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/Avalonia.Controls/Automation/AutomationElementIdentifiers.cs b/src/Avalonia.Controls/Automation/AutomationElementIdentifiers.cs index 7f6bff11ad..4566cd9db5 100644 --- a/src/Avalonia.Controls/Automation/AutomationElementIdentifiers.cs +++ b/src/Avalonia.Controls/Automation/AutomationElementIdentifiers.cs @@ -11,18 +11,18 @@ namespace Avalonia.Automation /// Identifies the bounding rectangle automation property. The bounding rectangle property /// value is returned by the method. /// - public static AutomationProperty BoundingRectangleProperty { get; } = new(); + public static AutomationProperty BoundingRectangleProperty { get; } = new AutomationProperty(); /// /// Identifies the class name automation property. The class name property value is returned /// by the method. /// - public static AutomationProperty ClassNameProperty { get; } = new(); + public static AutomationProperty ClassNameProperty { get; } = new AutomationProperty(); /// /// Identifies the name automation property. The class name property value is returned /// by the method. /// - public static AutomationProperty NameProperty { get; } = new(); + public static AutomationProperty NameProperty { get; } = new AutomationProperty(); } } diff --git a/src/Avalonia.Controls/Automation/ExpandCollapsePatternIdentifiers.cs b/src/Avalonia.Controls/Automation/ExpandCollapsePatternIdentifiers.cs index 342bdaceb1..e2b6782162 100644 --- a/src/Avalonia.Controls/Automation/ExpandCollapsePatternIdentifiers.cs +++ b/src/Avalonia.Controls/Automation/ExpandCollapsePatternIdentifiers.cs @@ -10,6 +10,6 @@ namespace Avalonia.Automation /// /// Identifies automation property. /// - public static AutomationProperty ExpandCollapseStateProperty { get; } = new(); + public static AutomationProperty ExpandCollapseStateProperty { get; } = new AutomationProperty(); } } diff --git a/src/Avalonia.Controls/Automation/RangeValuePatternIdentifiers.cs b/src/Avalonia.Controls/Automation/RangeValuePatternIdentifiers.cs index e3fa744cc0..625b37d001 100644 --- a/src/Avalonia.Controls/Automation/RangeValuePatternIdentifiers.cs +++ b/src/Avalonia.Controls/Automation/RangeValuePatternIdentifiers.cs @@ -10,21 +10,21 @@ namespace Avalonia.Automation /// /// Identifies automation property. /// - public static AutomationProperty IsReadOnlyProperty { get; } = new(); + public static AutomationProperty IsReadOnlyProperty { get; } = new AutomationProperty(); /// /// Identifies automation property. /// - public static AutomationProperty MinimumProperty { get; } = new(); + public static AutomationProperty MinimumProperty { get; } = new AutomationProperty(); /// /// Identifies automation property. /// - public static AutomationProperty MaximumProperty { get; } = new(); + public static AutomationProperty MaximumProperty { get; } = new AutomationProperty(); /// /// Identifies automation property. /// - public static AutomationProperty ValueProperty { get; } = new(); + public static AutomationProperty ValueProperty { get; } = new AutomationProperty(); } } diff --git a/src/Avalonia.Controls/Automation/ScrollPatternIdentifiers.cs b/src/Avalonia.Controls/Automation/ScrollPatternIdentifiers.cs index ad10b96e17..d9e843e75a 100644 --- a/src/Avalonia.Controls/Automation/ScrollPatternIdentifiers.cs +++ b/src/Avalonia.Controls/Automation/ScrollPatternIdentifiers.cs @@ -15,31 +15,31 @@ namespace Avalonia.Automation /// /// Identifies automation property. /// - public static AutomationProperty HorizontallyScrollableProperty { get; } = new(); + public static AutomationProperty HorizontallyScrollableProperty { get; } = new AutomationProperty(); /// /// Identifies automation property. /// - public static AutomationProperty HorizontalScrollPercentProperty { get; } = new(); + public static AutomationProperty HorizontalScrollPercentProperty { get; } = new AutomationProperty(); /// /// Identifies automation property. /// - public static AutomationProperty HorizontalViewSizeProperty { get; } = new(); + public static AutomationProperty HorizontalViewSizeProperty { get; } = new AutomationProperty(); /// /// Identifies automation property. /// - public static AutomationProperty VerticallyScrollableProperty { get; } = new(); + public static AutomationProperty VerticallyScrollableProperty { get; } = new AutomationProperty(); /// /// Identifies automation property. /// - public static AutomationProperty VerticalScrollPercentProperty { get; } = new(); + public static AutomationProperty VerticalScrollPercentProperty { get; } = new AutomationProperty(); /// /// Identifies automation property. /// - public static AutomationProperty VerticalViewSizeProperty { get; } = new(); + public static AutomationProperty VerticalViewSizeProperty { get; } = new AutomationProperty(); } } diff --git a/src/Avalonia.Controls/Automation/SelectionPatternIdentifiers.cs b/src/Avalonia.Controls/Automation/SelectionPatternIdentifiers.cs index ce4fdda739..c3669528cd 100644 --- a/src/Avalonia.Controls/Automation/SelectionPatternIdentifiers.cs +++ b/src/Avalonia.Controls/Automation/SelectionPatternIdentifiers.cs @@ -10,16 +10,16 @@ namespace Avalonia.Automation /// /// Identifies automation property. /// - public static AutomationProperty CanSelectMultipleProperty { get; } = new(); + public static AutomationProperty CanSelectMultipleProperty { get; } = new AutomationProperty(); /// /// Identifies automation property. /// - public static AutomationProperty IsSelectionRequiredProperty { get; } = new(); + public static AutomationProperty IsSelectionRequiredProperty { get; } = new AutomationProperty(); /// /// Identifies the property that gets the selected items in a container. /// - public static AutomationProperty SelectionProperty { get; } = new(); + public static AutomationProperty SelectionProperty { get; } = new AutomationProperty(); } } diff --git a/src/Windows/Avalonia.Win32/Automation/AutomationNode.cs b/src/Windows/Avalonia.Win32/Automation/AutomationNode.cs index 8a5488b1f1..c7021e6d53 100644 --- a/src/Windows/Avalonia.Win32/Automation/AutomationNode.cs +++ b/src/Windows/Avalonia.Win32/Automation/AutomationNode.cs @@ -25,7 +25,7 @@ namespace Avalonia.Win32.Automation IRawElementProviderAdviseEvents, IInvokeProvider { - private static Dictionary s_propertyMap = new() + private static Dictionary s_propertyMap = new Dictionary() { { AutomationElementIdentifiers.BoundingRectangleProperty, UiaPropertyId.BoundingRectangle }, { AutomationElementIdentifiers.ClassNameProperty, UiaPropertyId.ClassName }, @@ -276,7 +276,7 @@ namespace Avalonia.Win32.Automation var peer = Peer; var parent = peer.GetParent(); - while (peer is not AAP.IRootProvider && parent is object) + while (!(peer is AAP.IRootProvider) && parent is object) { peer = parent; parent = peer.GetParent();