本文整理汇总了C#中ILexEntry.ReplaceMoForm方法的典型用法代码示例。如果您正苦于以下问题:C# ILexEntry.ReplaceMoForm方法的具体用法?C# ILexEntry.ReplaceMoForm怎么用?C# ILexEntry.ReplaceMoForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILexEntry
的用法示例。
在下文中一共展示了ILexEntry.ReplaceMoForm方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SwapValues
private void SwapValues(ILexEntry entry, IMoForm origForm, IMoForm newForm, IMoMorphType type,
List<IMoMorphSynAnalysis> rgmsaOld)
{
DataTree dtree = Slice.ContainingDataTree;
int idx = Slice.IndexInContainer;
dtree.DoNotRefresh = true; // don't let the datatree repeatedly redraw itself...
entry.ReplaceMoForm(origForm, newForm);
newForm.MorphTypeRA = type;
entry.ReplaceObsoleteMsas(rgmsaOld);
// Dispose of any obsolete slices: new ones will replace them automatically in a moment
// when the datatree is redrawn.
foreach (Slice slice in Slice.ContainingDataTree.Slices.ToArray())
{
if (slice.IsDisposed)
continue;
if (slice.Object is IMoMorphSynAnalysis && rgmsaOld.Contains(slice.Object as IMoMorphSynAnalysis))
slice.Dispose();
else if (slice is MSAReferenceComboBoxSlice)
slice.Dispose();
}
// now fix the record list, since it may be showing MoForm dependent columns (e.g. MorphType, Homograph, etc...)
dtree.FixRecordList();
dtree.DoNotRefresh = false;
Slice sliceT = dtree.Slices[idx];
if (sliceT != null && sliceT is MorphTypeAtomicReferenceSlice)
{
// When the new slice is created, the launch button is placed in the middle of
// the slice rather than at the end. This fiddling with the slice width seems
// to fix that. Then setting the index restores focus to the new slice.
sliceT.Width += 1;
sliceT.Width -= 1;
dtree.GotoNextSliceAfterIndex(idx - 1);
}
}