CreateNewFragment() protected method

Bind this instance to a new empty DomFragment configured with the default options.
protected CreateNewFragment ( ) : void
return void
コード例 #1
0
ファイル: Create.cs プロジェクト: asmboom/HtmlRenderer
        /// <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);
        }
コード例 #2
0
ファイル: Create.cs プロジェクト: asmboom/HtmlRenderer
        /// <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);
        }
コード例 #3
0
        /// <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);
        }
コード例 #4
0
        /// <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);
        }
コード例 #5
0
ファイル: Create.cs プロジェクト: Vitallium/CsQuery
 /// <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;
 }
コード例 #6
0
ファイル: Create.cs プロジェクト: asmboom/HtmlRenderer
        /// <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);
        }
コード例 #7
0
ファイル: Create.cs プロジェクト: prepare/HTML-Renderer
        /// <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;
        }
コード例 #8
0
ファイル: Create.cs プロジェクト: prepare/HTML-Renderer
        /// <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;
        }
コード例 #9
0
ファイル: Create.cs プロジェクト: kaleb/CsQuery
 /// <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;
 }
コード例 #10
0
ファイル: Create.cs プロジェクト: kaleb/CsQuery
        /// <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;
        }