|
|
@ -160,11 +160,6 @@ namespace Avalonia.Win32.Automation |
|
|
return null; |
|
|
return null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (Peer.GetType().Name == "PopupAutomationPeer") |
|
|
|
|
|
{ |
|
|
|
|
|
System.Diagnostics.Debug.WriteLine("Popup automation node navigate " + direction); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return InvokeSync(() => |
|
|
return InvokeSync(() => |
|
|
{ |
|
|
{ |
|
|
return direction switch |
|
|
return direction switch |
|
|
@ -183,11 +178,11 @@ namespace Avalonia.Win32.Automation |
|
|
|
|
|
|
|
|
public static AutomationNode? GetOrCreate(AutomationPeer? peer) |
|
|
public static AutomationNode? GetOrCreate(AutomationPeer? peer) |
|
|
{ |
|
|
{ |
|
|
if (peer is null) |
|
|
return peer is null ? null : s_nodes.GetValue(peer, Create); |
|
|
return null; |
|
|
|
|
|
return s_nodes.GetValue(peer, x => new AutomationNode(x)); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void Release(AutomationPeer peer) => s_nodes.Remove(peer); |
|
|
|
|
|
|
|
|
IRawElementProviderSimple[]? IRawElementProviderFragment.GetEmbeddedFragmentRoots() => null; |
|
|
IRawElementProviderSimple[]? IRawElementProviderFragment.GetEmbeddedFragmentRoots() => null; |
|
|
void IRawElementProviderSimple2.ShowContextMenu() => InvokeSync(() => Peer.ShowContextMenu()); |
|
|
void IRawElementProviderSimple2.ShowContextMenu() => InvokeSync(() => Peer.ShowContextMenu()); |
|
|
void IInvokeProvider.Invoke() => InvokeSync((AAP.IInvokeProvider x) => x.Invoke()); |
|
|
void IInvokeProvider.Invoke() => InvokeSync((AAP.IInvokeProvider x) => x.Invoke()); |
|
|
@ -294,6 +289,11 @@ namespace Avalonia.Win32.Automation |
|
|
return peer is object ? GetOrCreate(peer) : null; |
|
|
return peer is object ? GetOrCreate(peer) : null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static AutomationNode Create(AutomationPeer peer) |
|
|
|
|
|
{ |
|
|
|
|
|
return peer is AAP.IRootProvider ? new RootAutomationNode(peer) : new AutomationNode(peer); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private static UiaControlTypeId ToUiaControlType(AutomationControlType role) |
|
|
private static UiaControlTypeId ToUiaControlType(AutomationControlType role) |
|
|
{ |
|
|
{ |
|
|
return role switch |
|
|
return role switch |
|
|
|