Пример #1
0
        private void _openDirectory_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog openDir = new FolderBrowserDialog();

            openDir.RootFolder = Environment.SpecialFolder.Personal;

            // Set the help text description for the FolderBrowserDialog.
            openDir.Description =
                "Select the folder with Writing Systems";

            // Allow the user to create new files via the FolderBrowserDialog.
            openDir.ShowNewFolderButton = true;

            // Display the openFile dialog.
            DialogResult result = openDir.ShowDialog();

            if (result == DialogResult.OK)
            {
                var newDir = openDir.SelectedPath;

                var repository = LdmlInFolderWritingSystemRepository.Initialize(newDir,
                                                                                DummyWritingSystemHandler.onMigration,
                                                                                DummyWritingSystemHandler.onLoadProblem);
                var dlg = new WritingSystemSetupDialog(repository);

                dlg.WritingSystemSuggestor.SuggestVoice             = true;
                dlg.WritingSystemSuggestor.OtherKnownWritingSystems = null;
                dlg.Text = String.Format("Writing Systems in folder {0}", newDir);

                dlg.Show();
            }
        }
Пример #2
0
        private void _openGlobal_Click(object sender, EventArgs e)
        {
            var dlg = new WritingSystemSetupDialog(GlobalWritingSystemRepository.Instance);

            dlg.WritingSystemSuggestor.SuggestVoice             = true;
            dlg.WritingSystemSuggestor.OtherKnownWritingSystems = null;
            dlg.Text = String.Format("Writing Systems for all users of this computer");

            dlg.Show();
        }
		private void OnEditWsLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
		{
			using (var d = new WritingSystemSetupDialog(_wsModel))
			{
				if (_wsModel.HasCurrentSelection)
				{
					d.ShowDialog(_wsModel.CurrentRFC4646);
				}
				else
				{
					d.ShowDialog();
				}
			}
		}
Пример #4
0
		public void WritingSystemSetupDialog()
		{
			var runner = new CrossThreadTestRunner();
			runner.RunInSTA(
				delegate
				{
					using (var folder = new TemporaryFolder("WS-Test"))
					{
						//var dlg = new WritingSystemSetupDialog(folder.Path,
						//	DummyWritingSystemHandler.onMigration,
						//	DummyWritingSystemHandler.onLoadProblem);
						//that constructor is now obsolete, create repo first
						var repository = LdmlInFolderWritingSystemRepository.Initialize(folder.Path,
							DummyWritingSystemHandler.onMigration,
							DummyWritingSystemHandler.onLoadProblem);
						var dlg = new WritingSystemSetupDialog(repository);
						dlg.WritingSystemSuggestor.SuggestVoice = true;
						dlg.ShowDialog();
					}
				});
		}
Пример #5
0
		private void OnWritingSystemSetupDialogClicked(object sender, EventArgs e)
		{
			string tempPath = Path.GetTempPath() + "WS-Test";
			Directory.CreateDirectory(tempPath);
			if (!_KeyboardControllerInitialized)
			{
				KeyboardController.Initialize();
				_KeyboardControllerInitialized = true;

				foreach (string key in ErrorReport.Properties.Keys)
					Console.WriteLine("{0}: {1}", key, ErrorReport.Properties[key]);
			}
			var wsRepo = LdmlInFolderWritingSystemRepository.Initialize(tempPath, onMigration, onLoadProblem);
			using (var dialog = new WritingSystemSetupDialog(wsRepo))
			{
				dialog.WritingSystems.LocalKeyboardSettings = Settings.Default.LocalKeyboards;
				dialog.ShowDialog();
				Settings.Default.LocalKeyboards = dialog.WritingSystems.LocalKeyboardSettings;
				Settings.Default.Save();
			}
		}
Пример #6
0
 private void OnWritingSystemSetupDialogClicked(object sender, EventArgs e)
 {
     string tempPath = Path.GetTempPath() + "WS-Test";
     Directory.CreateDirectory(tempPath);
     KeyboardController.Initialize();
     try
     {
         var wsRepo = LdmlInFolderWritingSystemRepository.Initialize(tempPath, onMigration, onLoadProblem);
         using (var dialog = new WritingSystemSetupDialog(wsRepo))
         {
             dialog.WritingSystems.LocalKeyboardSettings = Settings.Default.LocalKeyboards;
             dialog.ShowDialog();
             Settings.Default.LocalKeyboards = dialog.WritingSystems.LocalKeyboardSettings;
             Settings.Default.Save();
         }
     }
     catch (Exception)
     {
         throw;
     }
     finally
     {
         KeyboardController.Shutdown();
     }
 }
		private void _openGlobal_Click(object sender, EventArgs e)
		{
			var dlg = new WritingSystemSetupDialog(GlobalWritingSystemRepository.Instance);
			dlg.WritingSystemSuggestor.SuggestVoice = true;
			dlg.WritingSystemSuggestor.OtherKnownWritingSystems = null;
			dlg.Text = String.Format("Writing Systems for all users of this computer");

			dlg.Show();
		}
		private void _openDirectory_Click(object sender, EventArgs e)
		{
			FolderBrowserDialog openDir = new FolderBrowserDialog();

			openDir.RootFolder = Environment.SpecialFolder.Personal;

			// Set the help text description for the FolderBrowserDialog.
			openDir.Description =
			"Select the folder with Writing Systems";

			// Allow the user to create new files via the FolderBrowserDialog.
			openDir.ShowNewFolderButton = true;

			// Display the openFile dialog.
			DialogResult result = openDir.ShowDialog();

			if (result == DialogResult.OK)
			{
				var newDir = openDir.SelectedPath;

				var repository = LdmlInFolderWritingSystemRepository.Initialize(newDir,
					DummyWritingSystemHandler.onMigration,
					DummyWritingSystemHandler.onLoadProblem);
				var dlg = new WritingSystemSetupDialog(repository);

				dlg.WritingSystemSuggestor.SuggestVoice = true;
				dlg.WritingSystemSuggestor.OtherKnownWritingSystems = null;
				dlg.Text = String.Format("Writing Systems in folder {0}", newDir);

				dlg.Show();
			}
		}