public static CreateFragment ( IEnumerable |
||
elements | IEnumerable |
/// A sequence of elements. /// |
Результат |
/// <summary> /// Runs a set of HTML creation selectors and returns result as a single enumerable. /// </summary> /// /// <param name="content"> /// A sequence of strings that are each valid HTML /// </param> /// /// <returns> /// A new sequence containing all the elements from all the selectors. /// </returns> protected IEnumerable <IDomObject> MergeContent(IEnumerable <string> content) { List <IDomObject> allContent = new List <IDomObject>(); foreach (var item in content) { allContent.AddRange(CQ.CreateFragment(item)); } return(allContent); }
/// <summary> /// Creeate a new fragment from HTML text. /// </summary> /// /// <param name="html"> /// A string of HTML /// </param> /// /// <returns> /// The new fragment. /// </returns> public static CQ CreateFragment(string html) { return(CQ.CreateFragment(Support.StringToCharArray(html))); }
/// <summary> /// Create a new CQ from an HTML fragment, and use quickSet to create attributes (and/or css) /// </summary> /// /// <param name="html"> /// A string of HTML. /// </param> /// <param name="quickSet"> /// an object containing CSS properties and attributes to be applied to the resulting fragment. /// </param> /// /// <returns> /// A new CQ object /// </returns> public static CQ Create(string html, object quickSet) { CQ csq = CQ.CreateFragment(html); return(csq.AttrSet(quickSet, true)); }