예제 #1
0
        void CheckAll()
        {
            bool clearRest = false;

            foreach (var issue in IssueList)
            {
                if (clearRest)
                {
                    issue.Severity = IssueSeverity.None;
                }
                else
                {
                    issue.Check();
                }
                // If issue is critical then...
                if (issue.Severity == IssueSeverity.Critical)
                {
                    // Skip checking other issues.
                    clearRest = true;
                }
                // Try to get issue from warnings list.
                var item = Warnings.FirstOrDefault(x => x.Name == issue.Name);
                // If issue found and not a problem then...
                if (item != null && issue.Severity == IssueSeverity.None)
                {
                    // Remove from the list.
                    Warnings.Remove(item);
                }
                // If issue not found and there is a problem then...
                else if (item != null && issue.Severity != IssueSeverity.None)
                {
                    // Add to the list.
                    Warnings.Add(issue);
                }
            }
            HasIssues = IgnoreAll
                                ? false
                                : Warnings.Any(x => x.Severity > IssueSeverity.Moderate);
            var ev = CheckCompleted;

            if (ev != null)
            {
                CheckCompleted(this, new EventArgs());
            }
        }