diff options
author | Mykyta Bondarenko <32954580+mykyta-bondarenko@users.noreply.github.com> | 2019-12-03 18:57:48 +0300 |
---|---|---|
committer | Mykyta Bondarenko <32954580+mykyta-bondarenko@users.noreply.github.com> | 2019-12-30 12:43:38 +0300 |
commit | f3918a333cc866639229813b1112deb47e984c72 (patch) | |
tree | a1a5248e428912931f5910b234f9a6b66adc86c1 /main/src | |
parent | 988a29d6302ead741b57dc1a9a534a4af43f1fc6 (diff) |
[947006][PlatformService] moved 'MakeAccessibilityAnnouncement' to `PlatformService `
Diffstat (limited to 'main/src')
4 files changed, 17 insertions, 10 deletions
diff --git a/main/src/addins/MacPlatform/MacPlatform.cs b/main/src/addins/MacPlatform/MacPlatform.cs index 656634f242..0f79d87179 100644 --- a/main/src/addins/MacPlatform/MacPlatform.cs +++ b/main/src/addins/MacPlatform/MacPlatform.cs @@ -418,6 +418,14 @@ namespace MonoDevelop.MacIntegration } } + internal override void MakeAccessibilityAnnouncement (string text) + { + using var message = new NSString (text); + using var dictionary = new NSDictionary (NSAccessibilityNotificationUserInfoKeys.AnnouncementKey, message, + NSAccessibilityNotificationUserInfoKeys.PriorityKey, NSAccessibilityPriorityLevel.High); + NSAccessibility.PostNotification (NSApplication.SharedApplication.AccessibilityMainWindow, NSAccessibilityNotifications.AnnouncementRequestedNotification, dictionary); + } + protected override string OnGetMimeTypeForUri (string uri) { var ext = Path.GetExtension (uri); diff --git a/main/src/addins/MacPlatform/MainToolbar/StatusBar.cs b/main/src/addins/MacPlatform/MainToolbar/StatusBar.cs index 1780680d9b..bbc28308a2 100644 --- a/main/src/addins/MacPlatform/MainToolbar/StatusBar.cs +++ b/main/src/addins/MacPlatform/MainToolbar/StatusBar.cs @@ -931,20 +931,12 @@ namespace MonoDevelop.MacIntegration.MainToolbar if (changed) { ReconstructString (); // announce new status if vo/a11y is enabled - if (MonoDevelop.Ide.Desktop.PlatformService.AccessibilityInUse) { - MakeAccessibilityAnnouncement (text); + if (IdeServices.DesktopService.AccessibilityInUse) { + IdeServices.DesktopService.MakeAccessibilityAnnouncement (text); } } } - static void MakeAccessibilityAnnouncement (string text) - { - using var message = new NSString (text); - using var dictionary = new NSDictionary (NSAccessibilityNotificationUserInfoKeys.AnnouncementKey, message, - NSAccessibilityNotificationUserInfoKeys.PriorityKey, NSAccessibilityPriorityLevel.High); - NSAccessibility.PostNotification (NSApplication.SharedApplication.AccessibilityMainWindow, NSAccessibilityNotifications.AnnouncementRequestedNotification, dictionary); - } - bool LoadText (string message, bool isMarkup, MessageType statusType) { message = message ?? ""; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs index 2ecb25f055..47c7c983c9 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs @@ -513,6 +513,8 @@ namespace MonoDevelop.Ide.Desktop public static bool AccessibilityKeyboardFocusInUse { get; protected set; } + internal virtual void MakeAccessibilityAnnouncement (string text) { } + internal virtual string GetNativeRuntimeDescription () { return null; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs index 37c4cd60c9..a44b14be25 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs @@ -447,6 +447,11 @@ namespace MonoDevelop.Ide PlatformService.RestartIde (reopenWorkspace); } + public void MakeAccessibilityAnnouncement(string text) + { + PlatformService.MakeAccessibilityAnnouncement (text); + } + public bool AccessibilityInUse { get { return PlatformService.AccessibilityInUse; |