示例#1
0
        /// ------------------------------------------------------------------------------------
        internal PaVariant(ILexEntryRef lxEntryRef)
        {
            var lx = lxEntryRef.OwnerOfClass <ILexEntry>();

            xVariantForm = PaMultiString.Create(lx.LexemeFormOA.Form, lxEntryRef.Cache.ServiceLocator);
            xVariantInfo = new PaVariantOfInfo(lxEntryRef);
        }
示例#2
0
        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);
        }
示例#3
0
		/// ------------------------------------------------------------------------------------
		internal PaVariant(ILexEntryRef lxEntryRef)
		{
			var lx = lxEntryRef.OwnerOfClass<ILexEntry>();
			xVariantForm = PaMultiString.Create(lx.LexemeFormOA.Form, lxEntryRef.Cache.ServiceLocator);
			xVariantInfo = new PaVariantOfInfo(lxEntryRef);
		}