예제 #1
0
 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);
     }
 }
예제 #2
0
        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;
        }