Esempio n. 1
0
        private AssessmentResultItem TranslateAssessmentResult(IAssessmentResult r)
        {
            var item = new AssessmentResultItem
            {
                CheckId        = r.Check.Id,
                Description    = r.Check.Description,
                DisplayName    = r.Check.DisplayName,
                HelpLink       = r.Check.HelpLink,
                Level          = r.Check.Level.ToString(),
                Message        = r.Message,
                TargetName     = r.TargetPath,
                Tags           = r.Check.Tags.ToArray(),
                TargetType     = r.TargetType,
                RulesetVersion = Engine.Configuration.DefaultRuleset.Version.ToString(),
                RulesetName    = Engine.Configuration.DefaultRuleset.Name,
                Timestamp      = r.Timestamp
            };

            if (r is IAssessmentNote)
            {
                item.Kind = AssessmentResultItemKind.Note;
            }
            else if (r is IAssessmentWarning)
            {
                item.Kind = AssessmentResultItemKind.Warning;
            }
            else if (r is IAssessmentError)
            {
                item.Kind = AssessmentResultItemKind.Error;
            }

            return(item);
        }
        public int CompareTo(IAssessmentResult other)
        {
            var surnameSort = string.Compare(this.Surname, other.Surname, StringComparison.OrdinalIgnoreCase);

            if (surnameSort == 0)
            {
                return string.Compare(this.Forenames, other.Forenames, StringComparison.OrdinalIgnoreCase);
            }

            return surnameSort;
        }