private static IEnumerable<CheckMessages> ParseCheckMessages(string fileName)
 {                                   
     XDocument xmlFile = XDocument.Load(fileName);
     Debug.Assert(xmlFile.Root.Name == "Rules");
     foreach (var ruleElement in xmlFile.Root.Elements("Rule"))
     {
         var check = new CheckMessages();
         check.Messages = new Dictionary<string, string>();
         check.Id = ruleElement.Attribute("CheckId").Value;
         foreach (var resolutionElement in ruleElement.Elements("Resolution"))
         {
             string resolutionName = resolutionElement.HasAttributes ? resolutionElement.Attribute("Name").Value : "Default";
             check.Messages[resolutionName] = resolutionElement.Value;
         }
         yield return check;  
     }
     yield break;
 }
Ejemplo n.º 2
0
        private static IEnumerable <CheckMessages> ParseCheckMessages(string fileName)
        {
            XDocument xmlFile = XDocument.Load(fileName);

            Debug.Assert(xmlFile.Root.Name == "Rules");
            foreach (var ruleElement in xmlFile.Root.Elements("Rule"))
            {
                var check = new CheckMessages();
                check.Messages = new Dictionary <string, string>();
                check.Id       = ruleElement.Attribute("CheckId").Value;
                foreach (var resolutionElement in ruleElement.Elements("Resolution"))
                {
                    string resolutionName = resolutionElement.HasAttributes ? resolutionElement.Attribute("Name").Value : "Default";
                    check.Messages[resolutionName] = resolutionElement.Value;
                }
                yield return(check);
            }
            yield break;
        }