private static void UpdateType(StructuralTerm structuralTerm, Type[] types, int index){ if (index < types.Length){ structuralTerm.TypeOfObject = types[index]; index++; if (structuralTerm.ParentTerm != null) UpdateType((StructuralTerm) structuralTerm.ParentTerm, types, index); } }
public static ValueTerm CreateValueTermFromStructuralTerm(StructuralTerm structuralTerm, ValueTerm parentValueTerm){ var term = new ValueTerm(structuralTerm.Session){ ParentValueTerm = parentValueTerm, BaseTaxonomy = structuralTerm.BaseTaxonomy, StructuralTerm = structuralTerm }; foreach (StructuralTerm enumerable in structuralTerm.StructuralTerms.Where(sterm => sterm.TypeOfObject == null)){ ValueTerm childTerm = CreateValueTermFromStructuralTerm(enumerable, term); childTerm.Key = enumerable.Key; childTerm.Name = enumerable.Name; term.ValueTerms.Add(childTerm); } return term; }