Ejemplo n.º 1
0
        internal static MultipleSelectorList Create(params SimpleSelector[] selectors)
        {
            var multiple = new MultipleSelectorList();

            foreach (var selector in selectors)
            {
                multiple.Selectors.Add(selector);
            }

            return(multiple);
        }
Ejemplo n.º 2
0
        internal static MultipleSelectorList Create(params SimpleSelector[] selectors)
        {
            var multiple = new MultipleSelectorList();

            foreach (var selector in selectors)
            {
                multiple.Selectors.Add(selector);
            }

            return multiple;
        }
Ejemplo n.º 3
0
        BaseSelector ObfuscateSelectors(BaseSelector selector)
        {
            Type ruleType = selector.GetType();

            if (ruleType == typeof(SimpleSelector))
            {
                string obf = ObfuscateSelectorPart(selector.ToString());
                if (obf == null)
                    return selector;
                else
                    return new SimpleSelector(obf);
            }

            if (ruleType == typeof(ComplexSelector))
            {
                var obf = new ComplexSelector();
                var cs = (ComplexSelector)selector;
                foreach (var sel in cs)
                    obf.AppendSelector(ObfuscateSelectors(sel.Selector), sel.Delimiter);
                return obf;
            }

            if (ruleType == typeof(AggregateSelectorList))
            {
                var cs = (AggregateSelectorList)selector;
                var obf = new AggregateSelectorList(cs.Delimiter);
                foreach (BaseSelector sel in cs)
                    obf.AppendSelector(ObfuscateSelectors(sel));
                return obf;
            }

            if (ruleType == typeof(MultipleSelectorList))
            {
                var obf = new MultipleSelectorList();
                var cs = (MultipleSelectorList)selector;
                foreach (BaseSelector sel in cs)
                    obf.AppendSelector(ObfuscateSelectors(sel));
                return obf;
            }

            return selector;
        }