SIL.FieldWorks.XWorks.ExportDialog.SetRoot C# (CSharp) Method

SetRoot() protected method

Allows process to find an appropriate root hvo and change the current root. Subclasses (e.g. NotebookExportDialog) can override.
protected SetRoot ( ICmObject cmo, int &clidRoot ) : int
cmo ICmObject
clidRoot int
return int
		protected virtual int SetRoot(ICmObject cmo, out int clidRoot)
		{
			clidRoot = -1;
			var hvoRoot = -1;
			// Handle LexEntries that no longer have owners.
			if (cmo is ILexEntry)
			{
				hvoRoot = m_cache.LanguageProject.LexDbOA.Hvo;
				clidRoot = m_cache.ServiceLocator.GetInstance<Virtuals>().LexDbEntries;
			}
			else if (cmo is ICmSemanticDomain)
			{
				hvoRoot = cmo.OwnerOfClass<ICmPossibilityList>().Hvo;
				clidRoot = CmPossibilityListTags.kClassId;
			}
			else if (cmo.Owner != null)
			{
				hvoRoot = cmo.Owner.Hvo;
				clidRoot = cmo.Owner.ClassID;
			}
			return hvoRoot;
		}