public static string CreateInput(string type, string name, string value) { ElementBuilder result = new ElementBuilder("input"); result.AddAttribute("type", type); result.AddAttribute("name", type); result.AddAttribute("value", value); return result.ToString(); }
public static string CreateURL(string url, string title, string text) { ElementBuilder result = new ElementBuilder("a"); result.AddAttribute("href", url); result.AddAttribute("title", title); result.AddContent(text); return result.ToString(); }
public static string CreateImage(string source, string alt, string title) { ElementBuilder result = new ElementBuilder("img"); result.AddAttribute("src", source); result.AddAttribute("alt", alt); result.AddAttribute("title", title); return result.ToString(); }
public static string CreateInput(string type, string name, string value) { ElementBuilder result = new ElementBuilder("input"); result.AddAttribute("type", type); result.AddAttribute("name", type); result.AddAttribute("value", value); return(result.ToString()); }
public static string CreateURL(string url, string title, string text) { ElementBuilder result = new ElementBuilder("a"); result.AddAttribute("href", url); result.AddAttribute("title", title); result.AddContent(text); return(result.ToString()); }
public static string CreateImage(string source, string alt, string title) { ElementBuilder result = new ElementBuilder("img"); result.AddAttribute("src", source); result.AddAttribute("alt", alt); result.AddAttribute("title", title); return(result.ToString()); }
public static void Main() { ElementBuilder htmlElement = new ElementBuilder("a"); htmlElement.AddAttribute("href", "www.softuni.bg"); htmlElement.AddAttribute("class", "links"); Console.WriteLine("Element with two attributes:"); Console.WriteLine(htmlElement.ToString()); htmlElement.AddContent("Software University"); Console.WriteLine("\nAdded content:"); Console.WriteLine(htmlElement.ToString()); ElementBuilder htmlElement2 = htmlElement * 4; Console.WriteLine("\nElement multiplied 4 times, and accessed through .Element:"); Console.WriteLine(htmlElement2.Element.ToString()); Console.ReadKey(); }