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


C# CQ.CreateNewFragment方法代码示例

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


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

示例1: Create

 /// <summary>
 /// Create a new CQ object from a single element. Unlike the constructor method <see cref="CsQuery.CQ"/>
 /// this new objet is not bound to any context from the element.
 /// </summary>
 ///
 /// <param name="element">
 /// The element to wrap
 /// </param>
 ///
 /// <returns>
 /// A new CQ object
 /// </returns>
 
 public static CQ Create(IDomObject element)
 {
     CQ csq = new CQ();
     if (element is IDomDocument) {
         csq.Document = (IDomDocument)element;
         csq.AddSelection(csq.Document.ChildNodes);
     } else {
         csq.CreateNewFragment(Objects.Enumerate(element));
     }
     return csq;
 }
开发者ID:Vitallium,项目名称:CsQuery,代码行数:24,代码来源:Create.cs

示例2: CreateFragment

        /// <summary>
        /// Creeate a new fragment from HTML text, in the context of a specific HTML tag.
        /// </summary>
        ///
        /// <param name="html">
        /// A string of HTML.
        /// </param>
        /// <param name="context">
        /// The HTML tag name which is the context
        /// </param>
        ///
        /// <returns>
        /// The new fragment.
        /// </returns>

        public static CQ CreateFragment(string html, string context)
        {
            CQ cq = new CQ();
            cq.CreateNewFragment(cq, html, context, DocType.Default);
            return cq;
        }
开发者ID:prepare,项目名称:HTML-Renderer,代码行数:21,代码来源:Create.cs

示例3: Create

        /// <summary>
        /// Creeate a new CQ object from a squence of elements, or another CQ object. The new object will
        /// contain clones of the original objects; they are no longer bound to their owning context. If
        /// you want to wrap these elements and retain their context, use "new CQ(...)" instead.
        /// </summary>
        ///
        /// <param name="elements">
        /// A sequence of elements.
        /// </param>
        ///
        /// <returns>
        /// A new CQ object.
        /// </returns>

        public static CQ Create(IEnumerable<IDomObject> elements)
        {
            CQ csq = new CQ();
            csq.CreateNewFragment(elements);
            return csq;
        }
开发者ID:prepare,项目名称:HTML-Renderer,代码行数:20,代码来源:Create.cs

示例4: Create

 /// <summary>
 /// Create a new CQ object from a single element. Unlike the constructor method <see cref="CsQuery.CQ"/>
 /// this new objet is not bound to any context from the element.
 /// </summary>
 ///
 /// <param name="element">
 /// The element to wrap
 /// </param>
 ///
 /// <returns>
 /// A new CQ object
 /// </returns>
 
 public static CQ Create(IDomObject element)
 {
     CQ csq = new CQ();
     csq.CreateNewFragment(Objects.Enumerate(element));
     return csq;
 }
开发者ID:kaleb,项目名称:CsQuery,代码行数:19,代码来源:Create.cs

示例5: CreateFragment

        /// <summary>
        /// Create a new fragment from HTML text.
        /// </summary>
        ///
        /// <param name="html">
        /// A character array containing HTML
        /// </param>
        ///
        /// <returns>
        /// The new fragment.
        /// </returns>

        public static CQ CreateFragment(char[] html)
        {
            CQ csq = new CQ();
            //csq.LoadFragment(html);
            csq.CreateNewFragment(html, HtmlParsingMode.Fragment);
            return csq;
        }
开发者ID:kaleb,项目名称:CsQuery,代码行数:19,代码来源:Create.cs


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