Пример #1
0
        public List <JunctionPoint <T> > ExplodeByParentJunctions()
        {
            List <JunctionPoint <T> > output = new List <JunctionPoint <T> >();

            ListDictionary <T, T> splits = items.SplitByParentJunction(2);

            if (splits.Any())
            {
                foreach (var pair in splits)
                {
                    JunctionPoint <T> newJunction = new JunctionPoint <T>();
                    newJunction.Learn(this);
                    newJunction.items    = pair.Value;
                    newJunction.rootItem = pair.Key;
                    //newJunction.ProcessItems(pair.Key);
                    output.Add(newJunction);
                }
            }
            else
            {
                output.Add(this);
                if (this.rootItem == null)
                {
                    var item = items.FirstOrDefault();
                    if (item != null)
                    {
                        item = item.parent as T;
                    }
                    rootItem = item;
                }
                //this.ProcessItems(item);
            }

            return(output);
        }