示例#1
0
        private void onAfterTreeViewCheck(TreeNode checkedTreeNode, ref bool _bRecursivelyCheckingAllSubNodes, TreeView targetTreeView, Callbacks.dMethod_ListString onTreeViewCheckClick)
        {
            if (false == _bRecursivelyCheckingAllSubNodes)
            {
                bRecursivelyCheckingAllSubNodes = true;
                O2Forms.setCheckBoxStatusForAllTreeNodeChilds_recursive(checkedTreeNode.Nodes, checkedTreeNode.Checked);
                O2Forms.setCheckBoxStatusForAllParentNodes_recursive(checkedTreeNode, false);

                var ltnCurrentlySelectedClasses = new List <TreeNode>();
                O2Forms.calculateListOfCurrentlySelectedClasses_Recursive(targetTreeView.Nodes, ltnCurrentlySelectedClasses);
                // clear this variable
                selectedFilteredSignatures = new List <FilteredSignature>();
                if (ltnCurrentlySelectedClasses.Count > 0)
                {
                    foreach (TreeNode tnTreeNode in ltnCurrentlySelectedClasses)
                    {
                        if (tnTreeNode.Tag != null)
                        {
                            switch (tnTreeNode.Tag.GetType().Name)
                            {
                            case "FilteredSignature":
                                var fsFilteredSig = (FilteredSignature)tnTreeNode.Tag;
                                if (false == selectedFilteredSignatures.Contains(fsFilteredSig))
                                {
                                    selectedFilteredSignatures.Add(fsFilteredSig);
                                }

                                break;

                            case "List`1":
                                //Type tTyp = tnTreeNode.Tag.GetType();
                                var lfsFilteredSignatures = (List <FilteredSignature>)tnTreeNode.Tag;
                                selectedFilteredSignatures.AddRange(lfsFilteredSignatures);
                                break;

                            default:
                                break;
                            }
                        }
                    }
                }

                // fire sevent with selected signatures
                Callbacks.raiseRegistedCallbacks(_onAfterSelect, new object[] { selectedFilteredSignatures });
                // create  list of signatures and fire event
                var lsCurrentlySelectedClasses = new List <String>();
                foreach (var fsFilteredSignature in selectedFilteredSignatures)
                {
                    if (false == lsCurrentlySelectedClasses.Contains(fsFilteredSignature.sOriginalSignature))
                    {
                        lsCurrentlySelectedClasses.Add(fsFilteredSignature.sOriginalSignature);
                    }
                }

                if (onTreeViewCheckClick != null)
                {
                    onTreeViewCheckClick.Invoke(lsCurrentlySelectedClasses);
                }


                bRecursivelyCheckingAllSubNodes = false;
            }
        }