Exemplo n.º 1
0
        private static string GetGuidelineEmoji(Guideline guideline)
        {
            string emoji = "";

            switch (guideline.Severity)
            {
            case "AVOID":
                emoji = ":no_entry:";
                break;

            case "DO NOT":
                emoji = ":x:";
                break;

            case "DO":
                emoji = ":heavy_check_mark:";
                break;

            case "CONSIDER":
                emoji = ":grey_question:";
                break;

            default:
                break;
            }
            return(emoji);
        }
Exemplo n.º 2
0
        public static ICollection <Guideline> ReadExisitingGuidelinesFile(string pathToExistingGuidelinesXml)
        {
            XDocument previousGuidelines = XDocument.Load(pathToExistingGuidelinesXml);

            HashSet <Guideline> guidelines = new HashSet <Guideline>();

            foreach (XElement guidelineFromXml in previousGuidelines.Root.DescendantNodes().OfType <XElement>())
            {
                Guideline guideline = new Guideline();
                guideline.Severity   = guidelineFromXml.Attribute(_Severity)?.Value;
                guideline.Subsection = guidelineFromXml.Attribute(_Subsection)?.Value;
                guideline.Section    = guidelineFromXml.Attribute(_Section)?.Value;
                guideline.Text       = guidelineFromXml?.Value;
                guideline.Key        = guidelineFromXml.Attribute(_Key)?.Value;

                guidelines.Add(guideline);
            }
            return(guidelines);
        }
Exemplo n.º 3
0
        public override bool Equals(object obj)
        {
            Guideline otherGuideline = obj as Guideline;

            return(otherGuideline != null && string.Equals(otherGuideline.Key, this.Key));
        }