Skip to content

Commit 35ccb67

Browse files
committed
Add extension to text editor that allows to inject automation peer that represents IntelliSense suggesiton list and the currently selected suggestion - to allow screen narrators to read the suggestion.
1 parent 9eed87a commit 35ccb67

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

ICSharpCode.AvalonEdit/Editing/TextArea.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,13 +1085,13 @@ public bool OverstrikeMode {
10851085

10861086
#endregion
10871087

1088-
#region AutomationPeer for IntelliSense
1088+
#region AutomationPeer override for CodeCompletion
10891089
/// <summary>
1090-
/// Gets or sets AutomationPeer instance used by IntelliSense.
1090+
/// Gets or sets AutomationPeer instance used by CodeCompletion.
10911091
/// CompletionWindow can use this property to inject AutomationPeer that reflects
10921092
/// the suggestion list and the value of the currently selected CompletionData item.
10931093
/// </summary>
1094-
public System.Windows.Automation.Peers.AutomationPeer ActiveIntelliSenseAutomationPeer { get; set; }
1094+
public System.Windows.Automation.Peers.AutomationPeer CodeCompletionAutomationPeer { get; set; }
10951095
#endregion
10961096

10971097
/// <inheritdoc/>

ICSharpCode.AvalonEdit/Editing/TextRangeProvider.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public ITextRangeProvider Clone()
7676
public bool Compare(ITextRangeProvider range)
7777
{
7878
TextRangeProvider other = (TextRangeProvider)range;
79-
if (textArea.ActiveIntelliSenseAutomationPeer != null) {
79+
if (textArea.CodeCompletionAutomationPeer != null) {
8080
Log("{0}.Compare({1}) [ActiveIntelliSenseAutomationPeer != null]= false", ID, other.ID);
8181
return false;
8282
}
@@ -199,8 +199,8 @@ public IRawElementProviderSimple GetEnclosingElement()
199199
public string GetText(int maxLength)
200200
{
201201
Log("{0}.GetText({1})", ID, maxLength);
202-
if (textArea.ActiveIntelliSenseAutomationPeer != null) {
203-
var result = textArea.ActiveIntelliSenseAutomationPeer.GetName();
202+
if (textArea.CodeCompletionAutomationPeer != null) {
203+
var result = textArea.CodeCompletionAutomationPeer.GetName();
204204
Log("{0}.GetText({1}) --> {2}", ID, maxLength, result);
205205
return result;
206206
}

0 commit comments

Comments
 (0)