コード例 #1
0
ファイル: _Constructors.cs プロジェクト: Vitallium/CsQuery
        private void _CQ(string selector, CQ context) {
             CsQueryParent = context;

            if (!String.IsNullOrEmpty(selector))
            {
                Selector = new Selector(selector);

                SetSelection(Selector.Select(Document, context),
                    Selector.IsHmtl ?
                        SelectionSetOrder.OrderAdded :
                        SelectionSetOrder.Ascending);
            }
            
        }
コード例 #2
0
ファイル: Select.cs プロジェクト: Vitallium/CsQuery
        /// <summary>
        /// Select elements from within a context.
        /// </summary>
        ///
        /// <param name="selector">
        /// A string containing a selector expression.
        /// </param>
        /// <param name="context">
        /// The point in the document at which the selector should begin matching; similar to the context
        /// argument of the CQ.Create(selector, context) method.
        /// </param>
        ///
        /// <returns>
        /// A new CQ object.
        /// </returns>
        ///
        /// <url>
        /// http://api.jquery.com/jQuery/#jQuery1
        /// </url>

        public CQ Select(string selector, IDomObject context)
        {
            var selectors = new Selector(selector);
            var selection = selectors.Select(Document, context);

            CQ csq = NewInstance(selection, this);
            csq.Selector = selectors;
            return csq;
        }
コード例 #3
0
ファイル: Select.cs プロジェクト: xinmyname/CsQuery
        /// <summary>
        /// Select elements from within a context.
        /// </summary>
        ///
        /// <param name="selector">
        /// A string containing a selector expression.
        /// </param>
        /// <param name="context">
        /// The points in the document at which the selector should begin matching; similar to the
        /// context argument of the CQ.Create(selector, context) method. Only elements found below the
        /// members of the sequence in the document can be matched.
        /// </param>
        ///
        /// <returns>
        /// A new CQ object.
        /// </returns>
        ///
        /// <url>
        /// http://api.jquery.com/jQuery/#jQuery1
        /// </url>

        public CQ Select(string selector, IEnumerable<IDomObject> context)
        {
            var selectors = new Selector(selector).ToContextSelector();

            IEnumerable<IDomObject> selection = selectors.Select(Document, context);

            CQ csq = NewInstance(selection, (CQ)this);
            csq.Selector = selectors;
            return csq;
        }
コード例 #4
0
ファイル: Find.cs プロジェクト: Vitallium/CsQuery
 private CQ FindImpl(Selector selector)
 {
     CQ csq = NewCqInDomain();
     csq.AddSelection(selector.Select(Document, this));
     csq.Selector = selector;
     return csq;
 }