public void DefaultInitializer_HasCorrectPath()
        {
            GlobalWritingSystemRepository repo = GlobalWritingSystemRepository.Initialize();
            string expectedPath = string.Format(".*SIL.WritingSystemRepository.{0}",
                                                LdmlDataMapper.CurrentLdmlLibraryVersion);

            Assert.That(repo.PathToWritingSystems, Is.StringMatching(expectedPath));
        }
示例#2
0
        public WritingSystemTest()
        {
            InitializeComponent();

            _repository = GlobalWritingSystemRepository.Initialize(MigrationHandler);
            _wsModel    = new WritingSystemSetupModel(_repository);
            wsPropertiesPanel1.BindToModel(_wsModel);
        }
示例#3
0
        public WritingSystemPickerTestForm()
        {
            InitializeComponent();

            _repository = GlobalWritingSystemRepository.Initialize(null);
            _wsModel    = new WritingSystemSetupModel(_repository);
            _wsModel.SelectionChanged += _wsModel_SelectionChanged;
            wsPickerUsingListView1.BindToModel(_wsModel);
            pickerUsingComboBox1.BindToModel(_wsModel);
        }
        private void _openGlobal_Click(object sender, EventArgs e)
        {
            var dlg = new WritingSystemSetupDialog(GlobalWritingSystemRepository.Initialize());

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

            dlg.Show();
        }
示例#5
0
        /// ------------------------------------------------------------------------------------
        private IEnumerable <WritingSystemDefinition> GetAvailableWritingSystems()
        {
            // FLEx 9 uses C:\ProgramData\SIL\WritingSystemRepository
            var repoPath = Path.Combine(Program.SilCommonDataFolder, "WritingSystemRepository");

            if (Directory.Exists(repoPath))
            {
                var globalRepo = GlobalWritingSystemRepository.Initialize();
                return(globalRepo.AllWritingSystems);
            }

            var globalPath = Path.Combine(Program.SilCommonDataFolder, "WritingSystemStore");

            if (!Directory.Exists(globalPath))
            {
                var msg = LocalizationManager.GetString(
                    "DialogBoxes.Transcription.ExportToFieldWorksInterlinearDlg.CannotFindFLExWritingSystemsMsg1",
                    "In order to export, we need to find a writing system ID that FLEx will accept. SayMore " +
                    "tried to find a list of writing systems which FLEx knows about by looking in {0}, but it " +
                    "doesn't exist. We recommend that you let the code be 'en' (English), then change it inside of FLEx.",
                    "The parameter is a folder path");

                ErrorReport.NotifyUserOfProblem(msg, globalPath);
                return(new[] { new WritingSystemDefinition("en") });
            }

            try
            {
                var repo = LdmlInFolderWritingSystemRepository.Initialize(globalPath);
                return(repo.AllWritingSystems);
            }
            catch (Exception ex)
            {
                var msg = LocalizationManager.GetString(
                    "DialogBoxes.Transcription.ExportToFieldWorksInterlinearDlg.FLExWritingSystemRepositoryMsg",
                    "There was a problem initializing the Writing System Repository: \"{0}\"." +
                    "We recommend that you let the code be 'en' (English), then change it inside of FLEx.",
                    "The parameter is an error message");

                ErrorReport.NotifyUserOfProblem(msg, ex.Message);
                return(new[] { new WritingSystemDefinition("en") });
            }
        }
        public void DefaultInitializer_HasCorrectPath()
        {
            var repo = GlobalWritingSystemRepository.Initialize(OnMigration);

            Assert.That(repo.PathToWritingSystems, Is.StringMatching(".*SIL.WritingSystemRepository.2"));
        }