예제 #1
0
		public static int GetParentOfClass(FdoCache m_cache, int hvo, int classIdOfParentToSearchFor)
		{
			//save the caller the need to see if this property was empty or not
			if(hvo <1)
				return -1;

			int classId = m_cache.GetClassOfObject(hvo) ;

			while((!m_cache.IsSameOrSubclassOf(classId,classIdOfParentToSearchFor))
				&& (classId != FDO.LangProj.LangProject.kClassId))
			{
				hvo = m_cache.GetOwnerOfObject(hvo);
				classId = m_cache.GetClassOfObject(hvo) ;
			}
			if((!m_cache.IsSameOrSubclassOf(classId,classIdOfParentToSearchFor)))
				return -1;
			else
				return hvo;
		}