Пример #1
0
        private void Insert(Combinator combinator)
        {
            _hasCombinator = true;

            if (combinator != Combinator.Descendent)
            {
                _combinator = combinator;
            }
        }
Пример #2
0
 public void AppendSelector(ISelector selector, Combinator combinator)
 {
     if (!IsReady)
     {
         _selectors.Add(new CombinatorSelector
         {
             Selector = combinator.Change(selector),
             //Transform = combinator.Transform,
             Delimiter = combinator.Delimiter
         });
     }
 }
Пример #3
0
        internal SelectorFactory ResetFactory()
        {
            _attributeName         = null;
            _attributeValue        = null;
            _attributeOperator     = string.Empty;
            _selectorOperation     = SelectorOperation.Data;
            _combinator            = Combinator.Descendent;
            _hasCombinator         = false;
            _currentSelector       = null;
            _aggregateSelectorList = null;
            _complexSelector       = null;

            return(this);
        }
Пример #4
0
        private void Insert(BaseSelector selector)
        {
            if (_currentSelector != null)
            {
                if (!_hasCombinator)
                {
                    var compound = _currentSelector as AggregateSelectorList;

                    if (compound == null)
                    {
                        compound = new AggregateSelectorList("");
                        compound.AppendSelector(_currentSelector);
                    }

                    compound.AppendSelector(selector);
                    _currentSelector = compound;
                }
                else
                {
                    if (_complexSelector == null)
                    {
                        _complexSelector = new ComplexSelector();
                    }

                    _complexSelector.AppendSelector(_currentSelector, _combinator);
                    _combinator      = Combinator.Descendent;
                    _hasCombinator   = false;
                    _currentSelector = selector;
                }
            }
            else
            {
                if (_currentSelector == null && _complexSelector == null && _combinator == Combinator.Namespace)
                {
                    _complexSelector = new ComplexSelector();
                    _complexSelector.AppendSelector(SimpleSelector.Type(""), _combinator);
                    _currentSelector = selector;
                }
                else
                {
                    _combinator      = Combinator.Descendent;
                    _hasCombinator   = false;
                    _currentSelector = selector;
                }
            }
        }
Пример #5
0
 public ComplexSelector AppendSelector(BaseSelector selector, Combinator combinator)
 {
     _selectors.Add(new CombinatorSelector(selector, combinator));
     return(this);
 }
Пример #6
0
 private void Insert(Combinator combinator)
 {
     _combinators.Push(combinator);
 }
Пример #7
0
 public CombinatorSelector(BaseSelector selector, Combinator delimiter)
 {
     Selector  = selector;
     Delimiter = delimiter;
 }