public void AddSelector(CssSimpleElementSelector primExpr) { #if DEBUG if (primExpr == null) { } #endif if (_elementSelector == null) { _elementSelector = primExpr; } else { CssCompundElementSelector combinatorExpr = _elementSelector as CssCompundElementSelector; if (combinatorExpr != null) { combinatorExpr.RightSelector = primExpr; } else { CssSimpleElementSelector currentPrimExpr = _elementSelector as CssSimpleElementSelector; if (currentPrimExpr != null) { combinatorExpr = new CssCompundElementSelector(CssCombinatorOperator.Descendant); combinatorExpr.LeftSelector = _elementSelector; combinatorExpr.RightSelector = primExpr; _elementSelector = combinatorExpr; } else { } } } }
public override bool IsSameNameAndType(CssElementSelector anotherSelector) { if (anotherSelector == null) { return(false); } if (anotherSelector == this) { return(true); } //------------------------------ CssSimpleElementSelector another = anotherSelector as CssSimpleElementSelector; return(another != null && (another.Name == this.Name) && (another.selectorType == this.selectorType)); }
public void PrepareExpression(CssCombinatorOperator combinator) { switch (combinator) { default: { } break; case CssCombinatorOperator.AdjacentSibling: { throw new NotSupportedException(); } break; case CssCombinatorOperator.Child: { throw new NotSupportedException(); } break; case CssCombinatorOperator.Descendant: { throw new NotSupportedException(); } break; case CssCombinatorOperator.GeneralSibling: { throw new NotSupportedException(); } break; case CssCombinatorOperator.List: { CssCompundElementSelector combinatorExpr = new CssCompundElementSelector(combinator); combinatorExpr.LeftSelector = _elementSelector; _elementSelector = combinatorExpr; } break; } }
public override bool IsSameNameAndType(CssElementSelector anotherSelector) { if (anotherSelector == null) { return(false); } if (anotherSelector == this) { return(true); } //------------------------------ CssCompundElementSelector another = anotherSelector as CssCompundElementSelector; if (another != null) { return(this.OperatorName == another.OperatorName && this.LeftSelector.IsSameNameAndType(another.LeftSelector) && this.RightSelector.IsSameNameAndType(another.RightSelector)); } return(false); }
public abstract bool IsSameNameAndType(CssElementSelector anotherSelector);
public override bool IsSameNameAndType(CssElementSelector anotherSelector) { if (anotherSelector == null) { return false; } if (anotherSelector == this) { return true; } //------------------------------ CssSimpleElementSelector another = anotherSelector as CssSimpleElementSelector; return another != null && (another.Name == this.Name) && (another.selectorType == this.selectorType); }
public override bool IsSameNameAndType(CssElementSelector anotherSelector) { if (anotherSelector == null) { return false; } if (anotherSelector == this) { return true; } //------------------------------ CssCompundElementSelector another = anotherSelector as CssCompundElementSelector; if (another != null) { return this.OperatorName == another.OperatorName && this.LeftSelector.IsSameNameAndType(another.LeftSelector) && this.RightSelector.IsSameNameAndType(another.RightSelector); } return false; }
public void AddSelector(CssSimpleElementSelector primExpr) { #if DEBUG if (primExpr == null) { } #endif if (elementSelector == null) { elementSelector = primExpr; } else { CssCompundElementSelector combinatorExpr = this.elementSelector as CssCompundElementSelector; if (combinatorExpr != null) { combinatorExpr.RightSelector = primExpr; } else { CssSimpleElementSelector currentPrimExpr = this.elementSelector as CssSimpleElementSelector; if (currentPrimExpr != null) { combinatorExpr = new CssCompundElementSelector(CssCombinatorOperator.Descendant); combinatorExpr.LeftSelector = this.elementSelector; combinatorExpr.RightSelector = primExpr; this.elementSelector = combinatorExpr; } else { } } } }
public void PrepareExpression(CssCombinatorOperator combinator) { switch (combinator) { default: { } break; case CssCombinatorOperator.AdjacentSibling: { throw new NotSupportedException(); } break; case CssCombinatorOperator.Child: { throw new NotSupportedException(); } break; case CssCombinatorOperator.Descendant: { throw new NotSupportedException(); } break; case CssCombinatorOperator.GeneralSibling: { throw new NotSupportedException(); } break; case CssCombinatorOperator.List: { CssCompundElementSelector combinatorExpr = new CssCompundElementSelector(combinator); combinatorExpr.LeftSelector = this.elementSelector; this.elementSelector = combinatorExpr; } break; } }