Browse Source

Don't use C#9 features.

Causing the build to fail on OSX/Linux
ui-automation-test
grokys 6 years ago
parent
commit
7f4222997b
  1. 6
      src/Avalonia.Controls/Automation/AutomationElementIdentifiers.cs
  2. 2
      src/Avalonia.Controls/Automation/ExpandCollapsePatternIdentifiers.cs
  3. 8
      src/Avalonia.Controls/Automation/RangeValuePatternIdentifiers.cs
  4. 12
      src/Avalonia.Controls/Automation/ScrollPatternIdentifiers.cs
  5. 6
      src/Avalonia.Controls/Automation/SelectionPatternIdentifiers.cs
  6. 4
      src/Windows/Avalonia.Win32/Automation/AutomationNode.cs

6
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 <see cref="AutomationPeer.GetBoundingRectangle"/> method.
/// </summary>
public static AutomationProperty BoundingRectangleProperty { get; } = new();
public static AutomationProperty BoundingRectangleProperty { get; } = new AutomationProperty();
/// <summary>
/// Identifies the class name automation property. The class name property value is returned
/// by the <see cref="AutomationPeer.GetClassName"/> method.
/// </summary>
public static AutomationProperty ClassNameProperty { get; } = new();
public static AutomationProperty ClassNameProperty { get; } = new AutomationProperty();
/// <summary>
/// Identifies the name automation property. The class name property value is returned
/// by the <see cref="AutomationPeer.GetName"/> method.
/// </summary>
public static AutomationProperty NameProperty { get; } = new();
public static AutomationProperty NameProperty { get; } = new AutomationProperty();
}
}

2
src/Avalonia.Controls/Automation/ExpandCollapsePatternIdentifiers.cs

@ -10,6 +10,6 @@ namespace Avalonia.Automation
/// <summary>
/// Identifies <see cref="IExpandCollapseProvider.ExpandCollapseState"/> automation property.
/// </summary>
public static AutomationProperty ExpandCollapseStateProperty { get; } = new();
public static AutomationProperty ExpandCollapseStateProperty { get; } = new AutomationProperty();
}
}

8
src/Avalonia.Controls/Automation/RangeValuePatternIdentifiers.cs

@ -10,21 +10,21 @@ namespace Avalonia.Automation
/// <summary>
/// Identifies <see cref="IRangeValueProvider.IsReadOnly"/> automation property.
/// </summary>
public static AutomationProperty IsReadOnlyProperty { get; } = new();
public static AutomationProperty IsReadOnlyProperty { get; } = new AutomationProperty();
/// <summary>
/// Identifies <see cref="IRangeValueProvider.Minimum"/> automation property.
/// </summary>
public static AutomationProperty MinimumProperty { get; } = new();
public static AutomationProperty MinimumProperty { get; } = new AutomationProperty();
/// <summary>
/// Identifies <see cref="IRangeValueProvider.Maximum"/> automation property.
/// </summary>
public static AutomationProperty MaximumProperty { get; } = new();
public static AutomationProperty MaximumProperty { get; } = new AutomationProperty();
/// <summary>
/// Identifies <see cref="IRangeValueProvider.Value"/> automation property.
/// </summary>
public static AutomationProperty ValueProperty { get; } = new();
public static AutomationProperty ValueProperty { get; } = new AutomationProperty();
}
}

12
src/Avalonia.Controls/Automation/ScrollPatternIdentifiers.cs

@ -15,31 +15,31 @@ namespace Avalonia.Automation
/// <summary>
/// Identifies <see cref="IScrollProvider.HorizontallyScrollable"/> automation property.
/// </summary>
public static AutomationProperty HorizontallyScrollableProperty { get; } = new();
public static AutomationProperty HorizontallyScrollableProperty { get; } = new AutomationProperty();
/// <summary>
/// Identifies <see cref="IScrollProvider.HorizontalScrollPercent"/> automation property.
/// </summary>
public static AutomationProperty HorizontalScrollPercentProperty { get; } = new();
public static AutomationProperty HorizontalScrollPercentProperty { get; } = new AutomationProperty();
/// <summary>
/// Identifies <see cref="IScrollProvider.HorizontalViewSize"/> automation property.
/// </summary>
public static AutomationProperty HorizontalViewSizeProperty { get; } = new();
public static AutomationProperty HorizontalViewSizeProperty { get; } = new AutomationProperty();
/// <summary>
/// Identifies <see cref="IScrollProvider.VerticallyScrollable"/> automation property.
/// </summary>
public static AutomationProperty VerticallyScrollableProperty { get; } = new();
public static AutomationProperty VerticallyScrollableProperty { get; } = new AutomationProperty();
/// <summary>
/// Identifies <see cref="IScrollProvider.VerticalScrollPercent"/> automation property.
/// </summary>
public static AutomationProperty VerticalScrollPercentProperty { get; } = new();
public static AutomationProperty VerticalScrollPercentProperty { get; } = new AutomationProperty();
/// <summary>
/// Identifies <see cref="IScrollProvider.VerticalViewSize"/> automation property.
/// </summary>
public static AutomationProperty VerticalViewSizeProperty { get; } = new();
public static AutomationProperty VerticalViewSizeProperty { get; } = new AutomationProperty();
}
}

6
src/Avalonia.Controls/Automation/SelectionPatternIdentifiers.cs

@ -10,16 +10,16 @@ namespace Avalonia.Automation
/// <summary>
/// Identifies <see cref="ISelectionProvider.CanSelectMultiple"/> automation property.
/// </summary>
public static AutomationProperty CanSelectMultipleProperty { get; } = new();
public static AutomationProperty CanSelectMultipleProperty { get; } = new AutomationProperty();
/// <summary>
/// Identifies <see cref="ISelectionProvider.IsSelectionRequired"/> automation property.
/// </summary>
public static AutomationProperty IsSelectionRequiredProperty { get; } = new();
public static AutomationProperty IsSelectionRequiredProperty { get; } = new AutomationProperty();
/// <summary>
/// Identifies the property that gets the selected items in a container.
/// </summary>
public static AutomationProperty SelectionProperty { get; } = new();
public static AutomationProperty SelectionProperty { get; } = new AutomationProperty();
}
}

4
src/Windows/Avalonia.Win32/Automation/AutomationNode.cs

@ -25,7 +25,7 @@ namespace Avalonia.Win32.Automation
IRawElementProviderAdviseEvents,
IInvokeProvider
{
private static Dictionary<AutomationProperty, UiaPropertyId> s_propertyMap = new()
private static Dictionary<AutomationProperty, UiaPropertyId> s_propertyMap = new Dictionary<AutomationProperty, UiaPropertyId>()
{
{ 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();

Loading…
Cancel
Save