コード例 #1
0
ファイル: StructuralTerm.cs プロジェクト: akingunes/eXpand
 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
ファイル: ValueTerm.cs プロジェクト: akingunes/eXpand
        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;
        }