public void populateFindingsResults_Findings(List <AnalysisSearch.FindingsResult> lfrFindingsResults,
                                                     String sFindingFilter, bool bUniqueList)
        {
            Dictionary <String, List <FindingViewItem> > dFilteredFindings = null;
            List <FindingViewItem> lviFindingViewItem =
                AnalysisSearch.calculateDictionaryWithFilteredFindingsResults(lfrFindingsResults, ref dFilteredFindings,
                                                                              sFindingFilter, bUniqueList);

            //AnalysisSearch.GUI.populateWithListOfFilteredFindings_ListBox(lbSearchResults_Findings, lviFindingViewItem, dFilteredFindings);
            //AnalysisSearch.GUI.populateWithListOfFilteredFindings_TreeView(tvSearchResults_Findings, lviFindingViewItem, dFilteredFindings);
            //lbSearchResults_Findings.Tag = lfrFindingsResults;
            AnalysisSearch.GUI.populateWithDictionaryOfFilteredFindings_TreeView(
                tv_CreateSavedAssessment_PerFindingsType, dFilteredFindings);
            tv_CreateSavedAssessment_PerFindingsType.Sort();
            tv_CreateSavedAssessment_PerFindingsType.Tag = lfrFindingsResults;
        }
        public void loadDataForCreateCustomAssessmentFile()
        {
            List <String> lsCurrentFilters = ascx_FindingsSearchViewer1.getCurrentFilters();
            //if (lsCurrentFilters.Count > 0)
            List <string> currentFilters = ascx_FindingsSearchViewer1.getSelectedFilters();

            if (currentFilters.Count > 0)
            {
                bool   bUniqueList    = true;
                String sFindingFilter = currentFilters[0];
                Dictionary <String, List <FindingViewItem> > dFilteredFindings = null;
                List <FindingViewItem> lviFindingViewItem = AnalysisSearch.calculateDictionaryWithFilteredFindingsResults
                                                            (
                    ascx_FindingsSearchViewer1.sasSavedAssessmentSearch.lfrFindingsResults, ref dFilteredFindings,
                    sFindingFilter, bUniqueList);

                AnalysisSearch.GUI.populateWithDictionaryOfFilteredFindings_TreeView(
                    tv_CreateSavedAssessment_PerFindingsType, dFilteredFindings);
            }
        }
Exemple #3
0
        /*//case 5: // Analysis.TraceType.Lost_Sink:
         *                              nNode.Attr.Fontcolor = nNode.Attr.Color = Microsoft.Glee.Drawing.Color.DarkOrange;
         *                              break;
         *                          case 2: // Analysis.TraceType.Source:
         *                              nNode.Attr.Fontcolor = nNode.Attr.Color = Microsoft.Glee.Drawing.Color.DarkRed;
         *                              break;
         *                          case 3: // Analysis.TraceType.Known_Sink:
         *                              nNode.Attr.Fontcolor = nNode.Attr.Color = Microsoft.Glee.Drawing.Color.Red;
         */

        public static List <TreeNode> populateTreeNodeCollectionWithFilteredSearch_Recursive(
            TreeNodeCollection trnTreeNodeCollection, List <AnalysisSearch.FindingsResult> lfrFindingsResults,
            bool bUniqueList, List <String> lsFiltersToApply, int iCurrentIndex)
        {
            if (iCurrentIndex < lsFiltersToApply.Count)
            {
                Dictionary <String, List <FindingViewItem> > dFilteredFindings = null;
                String sFindingFilter   = lsFiltersToApply[iCurrentIndex];
                var    ltnFilteredNodes = new List <TreeNode>();
                List <FindingViewItem> lviFindingViewItem =
                    AnalysisSearch.calculateDictionaryWithFilteredFindingsResults(lfrFindingsResults,
                                                                                  ref dFilteredFindings, sFindingFilter,
                                                                                  bUniqueList);
                foreach (String sFilteredFinding in dFilteredFindings.Keys)
                {
                    String sNodeName = sFilteredFinding;
                    if (sFindingFilter != "Confidence" && sFindingFilter != "Severity")
                    {
                        sNodeName = sFindingFilter + ": " + sNodeName;
                    }
                    Color cColor = getColorFromFilter(sFindingFilter);
                    if (bUniqueList)
                    {
                        Int32 iImageId = getImageIdFromFilterAndFinding(sFindingFilter,
                                                                        dFilteredFindings[sFilteredFinding][0]);
                        sNodeName = String.Format("{0}             ({1})", sNodeName,
                                                  dFilteredFindings[sFilteredFinding].Count);
                        TreeNode tnFilteredFinding = O2Forms.newTreeNode(sNodeName, sFilteredFinding, iImageId,
                                                                         dFilteredFindings[sFilteredFinding]);
                        tnFilteredFinding.ForeColor = cColor;
                        trnTreeNodeCollection.Add(tnFilteredFinding);
                        //frFindingsResult.sStringThatMatchedCriteria);
                        ltnFilteredNodes.Add(tnFilteredFinding);
                    }
                    else
                    {
                        foreach (FindingViewItem fviFindingViewItem in dFilteredFindings[sFilteredFinding])
                        {
                            Int32 iImageId = getImageIdFromFilterAndFinding(sFindingFilter, fviFindingViewItem);
                            //String sNodeName = String.Format(sNodeName;
                            TreeNode tnFilteredFinding = O2Forms.newTreeNode(sNodeName, sFilteredFinding, iImageId,
                                                                             fviFindingViewItem);
                            tnFilteredFinding.ForeColor = cColor;
                            trnTreeNodeCollection.Add(tnFilteredFinding);
                            //frFindingsResult.sStringThatMatchedCriteria);
                            ltnFilteredNodes.Add(tnFilteredFinding);
                        }
                    }
                }

                if (++iCurrentIndex < lsFiltersToApply.Count)
                {
                    foreach (TreeNode tnTreeNode in ltnFilteredNodes)
                    {
                        /*                        List<AnalysisSearch.FindingsResult> lfrTreeNodeFindingsResults = new List<AnalysisSearch.FindingsResult>();
                         *                      foreach (FindingViewItem fviFindingViewItem in dFilteredFindings[tnTreeNode.Tag.ToString()])// ((Dictionary<String, List<FindingViewItem>>)tnTreeNode.Tag).Values)
                         *                          lfrTreeNodeFindingsResults.Add(fviFindingViewItem.frFindingResult);
                         *
                         */
                        populateTreeNodeCollectionWithFilteredSearch_Recursive(
                            tnTreeNode.Nodes,
                            getFindingsResultsListFromTreeNodeTag(tnTreeNode),
                            bUniqueList,
                            lsFiltersToApply,
                            iCurrentIndex);
                    }
                }
                return(ltnFilteredNodes);
            }
            return(null);
        }