1 /// <summary>2 ///recursively changes the organization tree selected state. 3 /// </summary>4 /// <param name= "org" ></param>5 Private voidrecursionorgdatatreestatus (orgdata org)6 {7 foreach(varIteminchorg. Nodes)8 {9Item. IsChecked =org. IsChecked;Ten if(item. Nodes.count >0) One { A recursionorgdatatreestatus (item); - } - } the } - - - ///Gets the selected organization data. + /// </summary> - Private voidGetcheckedorgdata () + { A foreach(Orgdata Orgdatainchorgdatacollection) at { - if(orgdata.ischecked) Receiverdata.add (orgdata); - if(Orgdata.haschild) - { - Getcheckedorgchilddata (orgdata); - } in } - } to /// <summary> + ///gets the data selected by the child node of the selected organization. - /// </summary> the Private voidgetcheckedorgchilddata (orgdata org) * { $ foreach(Orgdata Orgdatainchorg. Nodes)Panax Notoginseng { - if(orgdata.ischecked) Receiverdata.add (orgdata); the if(Orgdata.haschild) getcheckedorgchilddata (orgdata); + } A } the + - /// <summary> $ ///recursively takes the node selected under the parent node. $ /// </summary> - /// <param name= "org" ></param> - Private voidgetcheckedorgdatabyorgparent (orgdata org) the { - if(org = =NULL)return;Wuyi if(org. Parent = =NULL&&org. IsChecked) receiverdata.add (org); the if(org. Parent! =NULL) - { Wu foreach(varNodeinchorg. Parent.nodes) - { About if(node. IsChecked) receiverdata.add (node); $ } - } - getcheckedorgdatabyorgparent (org. Parent); - } A + the - /// <summary> $ ///recursively deletes a node's parent node. the /// </summary> the /// <param name= "org" ></param> the Private voiddeletedorgdata (orgdata org) the { - if(org = =NULL)return; in if(org. Parent = =NULL)return; the receiverdata.remove (org. Parent); the deletedorgdata (org. Parent); About}
View Code
WPF TreeView Recursive Traversal related methods