Exemple #1
0
 private ProductSettings.ProductRequirements ExtractProductRequirementsRoot(XmlNodeList productRequirementsList)
 {
     ProductSettings.ProductRequirements requirementsRoot = new ProductSettings.ProductRequirements();
     if (productRequirementsList.Count > 0)
     {
         requirementsRoot = ExtractProductRequirements(productRequirementsList)[0];
     }
     return(requirementsRoot);
 }
Exemple #2
0
        private List <ProductSettings.ProductRequirements> ExtractProductRequirements(XmlNodeList productRequirementsList, string logicalOp = "")
        {
            List <ProductSettings.ProductRequirements> requirementsList = new List <ProductSettings.ProductRequirements>();

            foreach (XmlNode requirementsNode in productRequirementsList)
            {
                string nextLogicalOp = XmlParser.GetStringAttribute(requirementsNode, "Requirements", "logicalOp");
                ProductSettings.ProductRequirements requirements = new ProductSettings.ProductRequirements
                {
                    LogicalOperator = logicalOp
                };
                if (string.IsNullOrEmpty(requirements.LogicalOperator))
                {
                    requirements.LogicalOperator = Enum.GetName(typeof(RequirementHandlers.LogicalOperatorType), RequirementHandlers.LogicalOperatorType.AND); //default value
                }
                requirements.RequirementList  = ExtractProductRequirement(requirementsNode.SelectNodes("Requirement"));
                requirements.RequirementsList = ExtractProductRequirements(requirementsNode.SelectNodes("Requirements"), nextLogicalOp);
                requirementsList.Add(requirements);
            }

            return(requirementsList);
        }