SIL.FieldWorks.IText.SandboxBase.IhMissingEntry.MorphItem.GetPrimaryOrOwningEntry C# (CSharp) Method

GetPrimaryOrOwningEntry() public method

for variant relationships, return the primary entry (of which this morph is a variant). Otherwise, return the owning entry of the morph.
public GetPrimaryOrOwningEntry ( SIL.FieldWorks.FDO.FdoCache cache ) : ILexEntry
cache SIL.FieldWorks.FDO.FdoCache
return ILexEntry
				public ILexEntry GetPrimaryOrOwningEntry(FdoCache cache)
				{
					var repository = cache.ServiceLocator.GetInstance<ICmObjectRepository>();
					ILexEntry morphEntryReal = null;
					if (m_hvoMainEntryOfVariant != 0)
					{
						// for variant relationships, we want to allow trying to create a
						// new sense on the entry of which we are a variant.
						morphEntryReal = repository.GetObject(m_hvoMainEntryOfVariant) as ILexEntry;
					}
					else
					{
						var morph = repository.GetObject(m_hvoMorph);
						morphEntryReal = morph.Owner as ILexEntry;
					}
					return morphEntryReal;
				}