コード例 #1
0
        public void DisplayOrCreateEntry_EmptyString()
        {
            ITsStrBldr emptyString = TsStrBldrClass.Create();

            Cache.MainCacheAccessor.SetString(1, 2, emptyString.GetString());
            // We shouldn't get an exception if we call DisplayOrCreateEntry with an empty string
            LexEntryUi.DisplayOrCreateEntry(Cache, 1, 2, 3, 0, 0, null, null, null, null);
        }
コード例 #2
0
        public void DisplayOrCreateEntry_EmptyString()
        {
            // Create a WfiWordform with some string.
            // We need this wordform to get a real hvo, flid, and ws.
            // Make Spanish be the vern ws.
            LgWritingSystem spanish = Cache.GetObject(Cache.WritingSystemFactory.GetWsFromStr("es")) as LgWritingSystem;

            Cache.LanguageProject.VernWssRC.Add(spanish);
            Cache.LanguageProject.CurVernWssRS.Add(spanish);
            Cache.LanguageProject.CurAnalysisWssRS.Remove(spanish);
            Cache.LanguageProject.AnalysisWssRC.Remove(spanish);
            int         defVernWs = spanish.Hvo;
            ITsString   form      = Cache.TsStrFactory.MakeString(String.Empty, defVernWs);
            WfiWordform wf        = new WfiWordform();

            Cache.LanguageProject.WordformInventoryOA.WordformsOC.Add(wf);
            wf.FormAccessor.set_String(defVernWs, form);

            // We shouldn't get an exception if we call DisplayOrCreateEntry with an empty string
            LexEntryUi.DisplayOrCreateEntry(Cache, wf.Hvo,
                                            (int)WfiWordform.WfiWordformTags.kflidForm, defVernWs, 0, 0,
                                            null, null, null, null);
        }