当前位置: 首页>>代码示例>>C#>>正文


C# CQ.SetSelection方法代码示例

本文整理汇总了C#中CsQuery.CQ.SetSelection方法的典型用法代码示例。如果您正苦于以下问题:C# CQ.SetSelection方法的具体用法?C# CQ.SetSelection怎么用?C# CQ.SetSelection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CsQuery.CQ的用法示例。


在下文中一共展示了CQ.SetSelection方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ConfigureNewInstance

 private void ConfigureNewInstance(CQ dom, IDomObject element, CQ context)
 {
     dom.CsQueryParent = context;
     dom.SetSelection(element, SelectionSetOrder.OrderAdded);
 }
开发者ID:Vitallium,项目名称:CsQuery,代码行数:5,代码来源:_Constructors.cs

示例2: CreateNewFragment

        /// <summary>
        /// Bind this instance to a new DomFragment created from HTML using the specified parsing mode and element context
        /// </summary>
        ///
        /// <param name="target">
        /// The target.
        /// </param>
        /// <param name="html">
        /// The HTML.
        /// </param>
        /// <param name="context">
        /// The context (e.g. an HTML tag name)
        /// </param>
        /// <param name="docType">
        /// (optional) type of the document.
        /// </param>

        protected void CreateNewFragment(CQ target,
          string html,
          string context,
          DocType docType)
        {
            target.Document = DomFragment.Create(html, context, docType);

            //  enumerate ChildNodes when creating a new fragment to be sure the selection set only
            //  reflects the original document. 

            target.SetSelection(Document.ChildNodes.ToList(), SelectionSetOrder.Ascending);
        }
开发者ID:emrahoner,项目名称:CsQuery,代码行数:29,代码来源:_Constructors.cs

示例3: CreateNew

        /// <summary>
        /// Bind this instance to a new DomFragment created from HTML in a specific HTML tag context.
        /// </summary>
        ///
        /// <param name="target">
        /// The target.
        /// </param>
        /// <param name="html">
        /// The HTML.
        /// </param>
        /// <param name="encoding">
        /// The character set encoding.
        /// </param>
        /// <param name="parsingMode">
        /// The HTML parsing mode.
        /// </param>
        /// <param name="parsingOptions">
        /// (optional) options for controlling the parsing.
        /// </param>
        /// <param name="docType">
        /// (optional) type of the document.
        /// </param>

        protected void CreateNew(CQ target,
          Stream html,
          Encoding encoding,
          HtmlParsingMode parsingMode,
          HtmlParsingOptions parsingOptions,
          DocType docType)
        {
            target.Document = DomDocument.Create(html, encoding, parsingMode,parsingOptions, docType);

            //  enumerate ChildNodes when creating a new fragment to be sure the selection set only
            //  reflects the original document. 

            target.SetSelection(Document.ChildNodes.ToList(), SelectionSetOrder.Ascending);
        }
开发者ID:emrahoner,项目名称:CsQuery,代码行数:37,代码来源:_Constructors.cs


注:本文中的CsQuery.CQ.SetSelection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。