本文整理汇总了C#中SIL.FieldWorks.FDO.FdoCache.GetVectorSize方法的典型用法代码示例。如果您正苦于以下问题:C# FdoCache.GetVectorSize方法的具体用法?C# FdoCache.GetVectorSize怎么用?C# FdoCache.GetVectorSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SIL.FieldWorks.FDO.FdoCache
的用法示例。
在下文中一共展示了FdoCache.GetVectorSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InsertObjectIntoVirtualBackref
static internal int InsertObjectIntoVirtualBackref(FdoCache cache, Mediator mediator, IVwVirtualHandler vh,
int hvoSlice, uint clidNewObj, uint clidOwner, uint flid)
{
if (vh != null)
{
int clidSlice = cache.GetClassOfObject(hvoSlice);
if (clidNewObj == LexEntry.kclsidLexEntry &&
clidSlice == LexEntry.kclsidLexEntry &&
clidOwner == LexDb.kclsidLexDb)
{
if (vh.FieldName == "VariantFormEntryBackRefs")
{
using (InsertVariantDlg dlg = new InsertVariantDlg())
{
ILexEntry entOld = LexEntry.CreateFromDBObject(cache, hvoSlice);
dlg.SetHelpTopic("khtpInsertVariantDlg");
dlg.SetDlgInfo(cache, mediator, entOld as IVariantComponentLexeme);
if (dlg.ShowDialog() == DialogResult.OK && dlg.NewlyCreatedVariantEntryRefResult)
{
int insertPos = cache.GetVectorSize(hvoSlice, (int)flid);
cache.PropChanged(hvoSlice, (int)flid, insertPos, 1, 0);
return insertPos;
}
// say we've handled this.
return -2;
}
}
}
}
return -1;
}
示例2: MakeAnalysisStringRep
// Make a string representing a WfiAnalysis, suitable for use in a combo box item.
static internal ITsString MakeAnalysisStringRep(int hvoWa, FdoCache fdoCache, bool fUseStyleSheet, int wsVern)
{
// ITsTextProps boldItalicAnalysis = BoldItalicAnalysis(fdoCache);
// ITsTextProps italicAnalysis = ItalicAnalysis(fdoCache, Sandbox.SandboxVc.krgbRed);
ITsTextProps posTextProperties = PartOfSpeechTextProperties(fdoCache, true, fUseStyleSheet);
ITsTextProps formTextProperties = FormTextProperties(fdoCache, fUseStyleSheet, wsVern);
ITsTextProps glossTextProperties = GlossTextProperties(fdoCache, true, fUseStyleSheet);
ITsStrBldr tsb = TsStrBldrClass.Create();
ISilDataAccess sda = fdoCache.MainCacheAccessor;
int cmorph = fdoCache.GetVectorSize(hvoWa,
(int)WfiAnalysis.WfiAnalysisTags.kflidMorphBundles);
if (cmorph == 0)
return fdoCache.MakeUserTss(ITextStrings.ksNoMorphemes);
bool fRtl = fdoCache.LanguageWritingSystemFactoryAccessor.get_EngineOrNull(wsVern).RightToLeft;
int start = 0;
int lim = cmorph;
int increment = 1;
if (fRtl)
{
start = cmorph - 1;
lim = -1;
increment = -1;
}
for (int i = start; i != lim; i += increment)
{
int hvoMb = fdoCache.GetVectorItem(hvoWa,
(int)WfiAnalysis.WfiAnalysisTags.kflidMorphBundles, i);
int hvoMf = fdoCache.GetObjProperty(hvoMb,
(int)WfiMorphBundle.WfiMorphBundleTags.kflidMorph);
ITsString tssForm = null;
if (hvoMf != 0)
{
int hvoEntry = fdoCache.GetOwnerOfObject(hvoMf);
int hvoLexemeForm = sda.get_ObjectProp(hvoEntry, (int) LexEntry.LexEntryTags.kflidLexemeForm);
if (hvoLexemeForm != 0)
{
tssForm = sda.get_MultiStringAlt(hvoLexemeForm, (int) MoForm.MoFormTags.kflidForm, wsVern);
}
if (tssForm == null || tssForm.Length == 0)
{
tssForm = fdoCache.MainCacheAccessor.get_MultiStringAlt(hvoEntry,
(int)LexEntry.LexEntryTags.kflidCitationForm, wsVern);
}
if (tssForm.Length == 0)
{
// If there isn't a lexeme form OR citation form use the form of the morph.
tssForm = fdoCache.MainCacheAccessor.get_MultiStringAlt(hvoMf,
(int)MoForm.MoFormTags.kflidForm, wsVern);
}
}
else // no MoForm linked to this bundle, use its own form.
{
tssForm = fdoCache.MainCacheAccessor.get_MultiStringAlt(hvoMb,
(int)WfiMorphBundle.WfiMorphBundleTags.kflidForm, wsVern);
}
int ichForm = tsb.Length;
tsb.ReplaceTsString(ichForm, ichForm, tssForm);
tsb.SetProperties(ichForm, tsb.Length,formTextProperties);
// add category (part of speech)
int hvoMsa = fdoCache.GetObjProperty(hvoMb,
(int)WfiMorphBundle.WfiMorphBundleTags.kflidMsa);
tsb.Replace(tsb.Length, tsb.Length, " ", null);
int ichMinMsa = tsb.Length;
string interlinName = ksMissingString;
if (hvoMsa != 0)
{
IMoMorphSynAnalysis msa =
MoMorphSynAnalysis.CreateFromDBObject(fdoCache, hvoMsa);
interlinName = msa.InterlinearAbbr;
}
tsb.Replace(ichMinMsa, ichMinMsa, interlinName, posTextProperties);
//add sense
int hvoSense = fdoCache.GetObjProperty(hvoMb,
(int)WfiMorphBundle.WfiMorphBundleTags.kflidSense);
tsb.Replace(tsb.Length, tsb.Length, " ", null);
int ichMinSense = tsb.Length;
if (hvoSense != 0)
{
ITsString tssGloss = fdoCache.MainCacheAccessor.get_MultiStringAlt(hvoSense,
(int)LexSense.LexSenseTags.kflidGloss, fdoCache.DefaultAnalWs);
tsb.Replace(ichMinSense, ichMinSense, tssGloss.Text, glossTextProperties);
}
else
tsb.Replace(ichMinSense, ichMinSense, ksMissingString, glossTextProperties);
// Enhance JohnT: use proper seps.
tsb.Replace(tsb.Length, tsb.Length, ksPartSeparator, null);
}
// Delete the final separator. (Enhance JohnT: this needs to get smarter when we do
// real seps.)
int ichFrom = tsb.Length - ksPartSeparator.Length;
if (ichFrom < 0)
ichFrom = 0;
tsb.Replace(ichFrom, tsb.Length, "", null);
return tsb.GetString();
}