Exemplo n.º 1
0
        private void Parse()
        {
            // Run through all score xml nodes of the filter xml node.
            foreach (XmlNode xmlNodeScore in this.XmlNode.ChildNodes.OrderByNumeric("Order"))
            {
                LinkBiDefinitionDimensionScore score = null;

                switch (xmlNodeScore.Name)
                {
                case "TaxonomyCategory":
                    // Create a new taxonomy category as score by the xml node.
                    score = new LinkBiDefinitionTaxonomyCategory(this, xmlNodeScore);
                    break;

                case "Category":
                    // Create a new taxonomy category as score by the xml node.
                    score = new LinkBiDefinitionCategory(this, xmlNodeScore);
                    break;

                case "ScoreGroup":
                    score = new LinkBiDefinitionScoreGroup(this, xmlNodeScore);
                    break;
                }

                // Check if it was possible to parse the score.
                if (score == null)
                {
                    continue;
                }

                if (score.Hidden)
                {
                    continue;
                }

                // Add the filter score to the filter's filter scores.
                this.Scores.Add(score);
            }
        }
Exemplo n.º 2
0
        public LinkBiDefinitionScoreGroup(LinkBiDefinitionDimension owner, XmlNode xmlNode)
            : base(owner, xmlNode)
        {
            this.Scores = new List <LinkBiDefinitionDimensionScore>();

            foreach (XmlNode xmlNodeScore in this.XmlNode.ChildNodes)
            {
                LinkBiDefinitionDimensionScore score = null;

                switch (xmlNodeScore.Name)
                {
                case "TaxonomyCategory":
                    // Create a new taxonomy category as score by the xml node.
                    score = new LinkBiDefinitionTaxonomyCategory(this.Owner, xmlNodeScore);
                    break;

                case "Category":
                    // Create a new category as score by the xml node.
                    score = new LinkBiDefinitionCategory(this.Owner, xmlNodeScore);
                    break;

                case "ScoreGroup":
                    score = new LinkBiDefinitionScoreGroup(this.Owner, xmlNodeScore);
                    break;
                }

                // Check if it was possible to parse the score.
                if (score == null)
                {
                    continue;
                }

                // Add the filter score to the filter's filter scores.
                this.Scores.Add(score);
            }
        }