public static string CreateInput(string type, string name, string value) { ElementBuilder input = new ElementBuilder("input"); input.AddAtributes("type", type); input.AddAtributes("name", name); input.AddAtributes("value", value); return input.ToString(); }
public static string CreateURL(string url2, string title, string text) { ElementBuilder url = new ElementBuilder("a"); url.AddAtributes("href", url2); url.AddAtributes("title", title); url.AddContent(text); return url.ToString(); }
public static string CreateImage(string imageSource, string alt, string title) { ElementBuilder img = new ElementBuilder("img"); img.AddAtributes("src", imageSource); img.AddAtributes("alt", alt); img.AddAtributes("title", title); return img.ToString(); }
static void Main(string[] args) { ElementBuilder div = new ElementBuilder("div"); div.AddAtributes("id", "page"); div.AddAtributes("class", "big"); div.AddContent("<p>Hello</p>"); Console.WriteLine(div * 2); Console.WriteLine(HTMLDispatcher.CreateImage("http://image.jpg", "this is a great image", "Mona Lisa")); }