void AdapterTree(TreeNode source, TreeNodeView parent) { foreach (var tn in source.Children) { if (tn.Type == "Source") { continue; } TreeNodeView tnv = new TreeNodeView(); tnv.ParentType = source.Type; tnv.TreeNode = tn; if (tn.Type == "For") { forTnv = tnv; } tnvs.Add(tnv); parent.AddChild(tnv); tnv.Title = tn.Title; tnv.NodeType = tn.Type; tnv.Code = tn.Code; tnv.State = 0; AdapterTree(tn, tnv); } }
public void Render() { tnvs.Clear(); tree.Children.Clear(); tv = new TreeNodeView(); tv.IsRoot = true; tv.i_down.MouseLeftButtonDown += i_down_MouseLeftButtonDown; tv.i_up.MouseLeftButtonDown += i_up_MouseLeftButtonDown; tnvs.Add(tv); tree.Children.Add(tv); tv.Title = Sequence.Name; tv.State = -1; AdapterTree(Sequence.Root, tv); }
public SingleFishboneLayoutAdapter([NotNull] BoxTree.Node realRoot) { Iterator = new GroupIterator(realRoot.State.NumberOfSiblings, realRoot.State.NumberOfSiblingColumns); RealRoot = realRoot; SpecialRoot = new TreeNodeView(Box.Special(Box.None, realRoot.Element.Id, true)) { Level = RealRoot.Level, ParentNode = RealRoot }; SpecialRoot.State.EffectiveLayoutStrategy = this; var parentStrategy = (MultiLineFishboneLayoutStrategy)realRoot.State.RequireLayoutStrategy(); SiblingSpacing = parentStrategy.SiblingSpacing; ParentConnectorShield = parentStrategy.ParentConnectorShield; ParentChildSpacing = parentStrategy.ParentChildSpacing; ParentAlignment = parentStrategy.ParentAlignment; ChildConnectorHookLength = parentStrategy.ChildConnectorHookLength; }