Ejemplo n.º 1
0
 public Termin(string name, TerminType type = TerminType.semc)
 {
     Name     = name;
     Type     = type;
     Parents  = new List <Termin>();
     Children = new List <Termin>();
 }
Ejemplo n.º 2
0
        public Termin AddTermin(int id, string name, TerminType type, IEnumerable <int> parentIds)
        {
            strToId[name] = id;
            var term = new Termin(name, type);

            if (parentIds == null || !parentIds.Any())
            {
                Root.Children.Add(term);
                term.Parents.Add(Root);
            }
            foreach (var parentId in parentIds)
            {
                var parent = Termins[parentId];
                term.Parents.Add(Termins[parentId]); //guaranteed to find parent if using klan
                parent.Children.Add(term);
            }
            Termins.Add(id, term);
            return(term);
        }