forked from unoplatform/uno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Adjust
HyperlinkButtonAutomationPeer
- Loading branch information
1 parent
369c38f
commit fc83ec9
Showing
1 changed file
with
23 additions
and
20 deletions.
There are no files selected for viewing
43 changes: 23 additions & 20 deletions
43
src/Uno.UI/UI/Xaml/Automation/Peers/HyperlinkButtonAutomationPeer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,34 @@ | ||
#pragma warning disable 108 // new keyword hiding | ||
#pragma warning disable 114 // new keyword hiding | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
// MUX Reference HyperlinkButtonAutomationPeer_Partial.cpp, tag winui3/release/1.4.2 | ||
|
||
using Microsoft.UI.Composition.Interactions; | ||
using Microsoft.UI.Xaml.Controls; | ||
|
||
namespace Microsoft.UI.Xaml.Automation.Peers | ||
namespace Microsoft.UI.Xaml.Automation.Peers; | ||
|
||
/// <summary> | ||
/// Exposes HyperlinkButton types to Microsoft UI Automation. | ||
/// </summary> | ||
public partial class HyperlinkButtonAutomationPeer : ButtonBaseAutomationPeer, Provider.IInvokeProvider | ||
{ | ||
public partial class HyperlinkButtonAutomationPeer : ButtonBaseAutomationPeer, Provider.IInvokeProvider | ||
public HyperlinkButtonAutomationPeer(HyperlinkButton owner) : base(owner) | ||
{ | ||
public HyperlinkButtonAutomationPeer(HyperlinkButton owner) : base(owner) | ||
{ | ||
} | ||
} | ||
|
||
protected override string GetClassNameCore() | ||
{ | ||
return "Hyperlink"; | ||
} | ||
protected override string GetClassNameCore() => "Hyperlink"; | ||
|
||
protected override AutomationControlType GetAutomationControlTypeCore() | ||
{ | ||
return AutomationControlType.Hyperlink; | ||
} | ||
protected override AutomationControlType GetAutomationControlTypeCore() | ||
=> AutomationControlType.Hyperlink; | ||
|
||
public void Invoke() | ||
public void Invoke() | ||
{ | ||
if (!IsEnabled()) | ||
{ | ||
if (IsEnabled()) | ||
{ | ||
(Owner as HyperlinkButton).AutomationPeerClick(); | ||
} | ||
// UIA_E_ELEMENTNOTENABLED | ||
throw new ElementNotEnabledException(); | ||
} | ||
|
||
(Owner as HyperlinkButton).AutomationPeerClick(); | ||
} | ||
} |