Example #1
0
 void HandleCodeIssueAdded(object sender, CodeIssueEventArgs e)
 {
     foreach (var issue in e.CodeIssues)
     {
         var summary = IssueSummary.FromCodeIssue(e.File, e.Provider, issue);
         rootGroup.AddIssue(summary);
     }
 }
Example #2
0
        public void AddIssue(IssueSummary issue)
        {
            IssueGroup group      = null;
            bool       groupAdded = false;
            bool       issueAdded = false;

            lock (_lock) {
                if (!allIssues.Contains(issue))
                {
                    IssueCount++;
                    allIssues.Add(issue);
                    ((IIssueTreeNode)issue).VisibleChanged += HandleVisibleChanged;
                    issueAdded = true;
                }
                if (processingEnabled)
                {
                    groupAdded = ProcessIssue(issue, out group);
                }
            }
            if (issueAdded)
            {
                OnTextChanged(new IssueGroupEventArgs(this));
            }
            if (!processingEnabled)
            {
                return;
            }
            if (groupAdded)
            {
                OnChildAdded(new IssueTreeNodeEventArgs(this, group));
            }
            else if (group == null)
            {
                OnChildAdded(new IssueTreeNodeEventArgs(this, issue));
            }
            if (group != null)
            {
                group.AddIssue(issue);
            }
        }