// public List<EventTest3> Ev2List { get; private set; } = null; public EventTestMgr() { Root = new EventTest3(0, 0, 0, 0, 0, true); Root.Name = "Root (" + Root.Name + ")"; MakeChildren(Root, 1, 0, Root.childList); First = new EventTest4(0, 0, 0, 0, 0, true); First.Name = "First (" + First.Name + ")"; MakeChildren(First, 1, 0, First.childList); Origin = new TreeNode5(); Origin.Configure(null, 0, 0, true, true); Origin.Name = "Origin"; TreeNode5 Top = new TreeNode5(); Top.Configure(Origin, 1, 1, true, true); Top.Name = "First Element"; Origin.AddChild(Top); MakeChildren(Top, 1, Top.Children); Trunk = new Branch(); Tests(); }
private void MakeChildren(TreeNode5 parent, int depth, ObservableCollection <TreeNode5> children) { if (depth >= MAX_DEPTH) { return; } for (int i = 0; i < MAX5; i++) { index++; TreeNode5 Evt = new TreeNode5(); if (i == 1 || i == 2) { // make a new branch // this branch is still associated with the parent branch // but its children are associated with the new branch Evt.Configure(parent, depth, index, true, false); Evt.Name = Evt.MakeName(); MakeChildren(Evt, depth + 1, Evt.Children); } else { Evt.Configure(parent, depth, index, false, false); Evt.Name = Evt.MakeName(); } children.Add(Evt); } }
private void CheckBox_LostFocus5(object sender, RoutedEventArgs e) { CheckBox cbx = (CheckBox)sender; TreeNode5 et = (TreeNode5)cbx.DataContext; et.TriStateReset(); }
private void resetTree(TreeNode5 evt) { evt.ResetTree(); // foreach (EventTest5 ev in evt.Children) // { // ev.Reset(); // // if (ev.NodeType == NodeType.BRANCH // && ev.ChildCount > 0) // { // resetTree(ev); // } // } }
public void Configure(TreeNode5 parent, int depth, int id, bool isBranch, bool isExpanded ) { this.parent = parent; this.depth = depth; this.id = id; IsExpanded = isExpanded; if (isBranch) { NodeType = NodeType.BRANCH; Children = new ObservableCollection <TreeNode5>(); } }