internal IdentitySelector(ISelectorContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            context.AddAttachedSelector(this);
            this.context = context;
            regex = new Regex("^#[-_]*([a-zA-Z]+[0-9_-]*)+");
        }
        internal LastChildSelector(ISelectorContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            context.AddAttachedSelector(this);
            this.context = context;
            regex = new Regex("^(:last-child)|(:last-of-type)");
        }
        internal FirstChildSelector(ISelectorContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            context.AddAttachedSelector(this);
            this.context = context;

            regex = new Regex("^:first-child");
        }
        internal NthChildSelector(ISelectorContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            context.AddAttachedSelector(this);
            this.context = context;

            regex = new Regex("^:nth-child\\(\\d+\\)");
        }
Пример #5
0
        internal NotSelector(ISelectorContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            context.AddAttachedSelector(this);
            this.context = context;

            regex = new Regex("^:not\\([a-zA-Z]+[0-9]*\\)");
            elementName = new Regex("\\([a-zA-Z]+[0-9]*\\)");
        }
        internal AttributeSelector(ISelectorContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            //Attribute Selector can be next a selector or an independent selector.
            context.AddAttachedSelector(this);

            this.context = context;

            isValid = new Regex("^\\[([a-zA-Z]+[0-9]*)+([~|^$*]?=+[\"']?([a-zA-Z]+[0-9]*)+[\"']?)*\\]");
            spliter = new Regex(@"\w+|[~|^$*]|=");
        }