/// ------------------------------------------------------------------------------------ internal PaVariant(ILexEntryRef lxEntryRef) { var lx = lxEntryRef.OwnerOfClass <ILexEntry>(); xVariantForm = PaMultiString.Create(lx.LexemeFormOA.Form, lxEntryRef.Cache.ServiceLocator); xVariantInfo = new PaVariantOfInfo(lxEntryRef); }
public override ObjectLabel Execute() { ObjectLabel result = null; if (m_lexEntryRef != null) { using (LinkEntryOrSenseDlg dlg = new LinkEntryOrSenseDlg()) { ILexEntry le = null; // assume the owner is the entry (e.g. owner of LexEntryRef) le = m_lexEntryRef.OwnerOfClass <ILexEntry>(); dlg.SetDlgInfo(m_cache, m_mediator, m_propertyTable, le); dlg.SetHelpTopic("khtpChooseLexicalEntryOrSense"); if (dlg.ShowDialog(m_parentWindow) == DialogResult.OK) { ICmObject obj = dlg.SelectedObject; if (obj != null) { if (!m_lexEntryRef.PrimaryLexemesRS.Contains(obj)) { try { UndoableUnitOfWorkHelper.DoUsingNewOrCurrentUOW( LexEdStrings.ksUndoCreatingEntry, LexEdStrings.ksRedoCreatingEntry, Cache.ActionHandlerAccessor, () => { if (!m_lexEntryRef.ComponentLexemesRS.Contains(obj)) { m_lexEntryRef.ComponentLexemesRS.Add(obj); } m_lexEntryRef.PrimaryLexemesRS.Add(obj); }); } catch (ArgumentException) { MessageBoxes.ReportLexEntryCircularReference(m_lexEntryRef.Owner, obj, true); } } } } } } return(result); }
/// ------------------------------------------------------------------------------------ internal PaVariant(ILexEntryRef lxEntryRef) { var lx = lxEntryRef.OwnerOfClass<ILexEntry>(); xVariantForm = PaMultiString.Create(lx.LexemeFormOA.Form, lxEntryRef.Cache.ServiceLocator); xVariantInfo = new PaVariantOfInfo(lxEntryRef); }