private void AddScreenReaderCommand(object sender, RoutedEventArgs e) { String fileExtention = ".grant"; String fileNamePath = guiFunctions.openFileDialog(fileExtention, "GRANT documents (.grant)|*.grant", Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)); if (fileNamePath == null) { System.Windows.Forms.MessageBox.Show("The chosen screen reader doesn't exist!", "GRANT exception"); return; } ScreenReaderFunctions srf = new ScreenReaderFunctions(strategyMgr); srf.addScreenReader(@fileNamePath); }
private void posibleScreenreaders() { SelectScreenReader.Items.Clear(); ScreenReaderFunctions srf = new ScreenReaderFunctions(strategyMgr); foreach (KeyValuePair <string, string> entry in srf.screenreaders) { MenuItem m = new MenuItem(); m.Header = entry.Key; m.IsCheckable = true; SelectScreenReader.Items.Add(m); } SelectScreenReader.UpdateLayout(); }
private void ScreenReaderCommand(object sender, RoutedEventArgs e) { if (e.Source != null && e.Source.GetType().Equals(typeof(MenuItem))) { if (((MenuItem)e.Source).Header != null && !((MenuItem)e.Source).Header.Equals("Select screen reader")) { MenuItem i = ((MenuItem)e.Source); ((MenuItem)e.Source).IsEnabled = false; ScreenReaderFunctions srf = new ScreenReaderFunctions(strategyMgr); uncheckedMenuItem(i); guiFunctions.loadGrantProject(srf.screenreaders[((MenuItem)e.Source).Header as String]); strategyMgr.getSpecifiedBrailleDisplay().generatedBrailleUi(); } } }