コード例 #1
0
        public void FindOrCreateSomeWritingSystem_Converts_x_To_qaa()
        {
            CoreWritingSystemDefinition ws;

            Assert.That(WritingSystemServices.FindOrCreateSomeWritingSystem(Cache, null, "x", true, false, out ws), Is.False);
            Assert.That(ws.Id, Is.EqualTo("qaa"));
        }
コード例 #2
0
        public void FindOrCreateSomeWritingSystem_Converts_Fr_Tech_30Oct_To_fr_x_Tech30Oct()
        {
            CoreWritingSystemDefinition ws;

            Assert.That(WritingSystemServices.FindOrCreateSomeWritingSystem(Cache, null, "Fr-Tech 30Oct", true, false, out ws), Is.False);
            Assert.That(ws.Id, Is.EqualTo("fr-x-Tech30Oc"));             //8 characters is the maximum allowed for a part.
        }
コード例 #3
0
        public void FindOrCreateSomeWritingSystem_Converts_x_unk_To_qaa_x_unk()
        {
            IWritingSystem ws;

            Assert.That(WritingSystemServices.FindOrCreateSomeWritingSystem(Cache, null, "x-unk", true, false, out ws), Is.False);
            Assert.That(ws.Id, Is.EqualTo("qaa-x-unk"));
        }
コード例 #4
0
        public void FindOrCreateSomeWritingSystem_Converts_Fr_Tech_30Oct_To_qaa_x_Fr_Tech_30Oct()
        {
            IWritingSystem ws;

            Assert.That(WritingSystemServices.FindOrCreateSomeWritingSystem(Cache, "Fr-Tech 30Oct", true, false, out ws), Is.False);
            Assert.That(ws.Id, Is.EqualTo("qaa-x-Fr-Tech30Oc"));             //8 characters is the maximum allowed for a part.
        }
コード例 #5
0
        private static ILgWritingSystem SafelyGetWritingSystem(FdoCache cache, ILgWritingSystemFactory wsFactory,
                                                               Language lang, out bool fIsVernacular)
        {
            fIsVernacular = lang.vernacularSpecified && lang.vernacular;
            ILgWritingSystem writingSystem = null;

            try
            {
                writingSystem = wsFactory.get_Engine(lang.lang);
            }
            catch (ArgumentException e)
            {
                IWritingSystem ws;
                WritingSystemServices.FindOrCreateSomeWritingSystem(cache, FwDirectoryFinder.TemplateDirectory, lang.lang,
                                                                    !fIsVernacular, fIsVernacular, out ws);
                writingSystem = ws;
                s_wsMapper.Add(lang.lang, writingSystem);                 // old id string -> new langWs mapping
            }
            return(writingSystem);
        }