Пример #1
0
        public DocumentTreeWrapper(IDataTree tree)
        {
            WrapperNode baseWrapper = new WrapperNode();

            baseWrapper.Keyword = tree.Root.Keyword;
            baseWrapper.Weight  = tree.MappedWords;
            Tree = new ObservableCollection <WrapperNode>();
            Tree.Add(baseWrapper);
            CreateNodes(tree.Root, baseWrapper);
        }
Пример #2
0
 private void CreateNodes(DataNode dataNode, WrapperNode baseWrapper)
 {
     if (dataNode.Children != null)
     {
         foreach (Connection c in dataNode.Children)
         {
             WrapperNode wrap = new WrapperNode();
             wrap.Keyword = c.EndPoint.Keyword;
             wrap.Weight  = c.Weight;
             baseWrapper.Children.Add(wrap);
             CreateNodes(c.EndPoint, wrap);
         }
     }
 }