static void Main() { ElementBuilder div = new ElementBuilder("div"); div.AddAttribute("id", "page"); div.AddAttribute("class", "big"); div.AddAttribute("style", "background-color: pink; border-bottom: 5px solid black; margin: auto; width: 200px"); div.AddContent("<p>Hello</p>"); Console.WriteLine(div * 2); string image = HTMLDispatcher.CreateImage("/cat.png", "cat", "Cat"); string url = HTMLDispatcher.CreateURL("http://www.someurl.com", "some url", "some text"); string input = HTMLDispatcher.CreateInput("field", "Name", "Some Name"); Console.WriteLine(div); Console.WriteLine(image); Console.WriteLine(url); Console.WriteLine(input); using (StreamWriter sw = new StreamWriter("index.html")) { sw.WriteLine(div); } }
static void Main() { var div = new ElementBuilder("div"); div.AddAttribute("id", "page"); div.AddAttribute("class", "big"); div.AddContent("<p>Hello</p>"); Console.WriteLine(div * 3); Console.WriteLine(); var p = new ElementBuilder("p"); p.AddAttribute("style", "font-size: 5px;"); Console.WriteLine(p); Console.WriteLine(); p.AddContent("This is a paragraph"); Console.WriteLine(p); Console.WriteLine(); Console.WriteLine(p * 15); Console.WriteLine(); var image = HTMLDispatcher.CreateImage(@"http://www.google.bg", "missing", "Google"); Console.WriteLine(image); Console.WriteLine(); var link = HTMLDispatcher.CreateURL(@"https://facebook.com", "Facebook", "Click me!"); Console.WriteLine(link); Console.WriteLine(); var input = HTMLDispatcher.CreateInput("radio", "gender", "0"); Console.WriteLine(input); Console.WriteLine(); }
public static string CreateImage(string imageSource, string alt, string title) { ElementBuilder imageElement = new ElementBuilder("img"); imageElement.AddAttribute("src", imageSource); imageElement.AddAttribute("alt", alt); imageElement.AddAttribute("title", title); return imageElement.ToString(); }
public static string CreateURL(string url, string title, string text) { ElementBuilder urlElement = new ElementBuilder("a"); urlElement.AddAttribute("url", url); urlElement.AddAttribute("title", title); urlElement.AddAttribute("text", text); return urlElement.ToString(); }
public static string CreateInput(string type, string name, string value) { ElementBuilder inputElement = new ElementBuilder("input"); inputElement.AddAttribute("type", type); inputElement.AddAttribute("name", name); inputElement.AddAttribute("value", value); return inputElement.ToString(); }
public static string CreateImage(string imageSource, string alt, string title) { ElementBuilder imageElement = new ElementBuilder("img"); imageElement.AddAttribute("src", imageSource); imageElement.AddAttribute("alt", alt); imageElement.AddAttribute("title", title); return(imageElement.ToString()); }
public static string CreateInput(string type, string name, string value) { ElementBuilder inputElement = new ElementBuilder("input"); inputElement.AddAttribute("type", type); inputElement.AddAttribute("name", name); inputElement.AddAttribute("value", value); return(inputElement.ToString()); }
public static string CreateURL(string url, string title, string text) { ElementBuilder urlElement = new ElementBuilder("a"); urlElement.AddAttribute("url", url); urlElement.AddAttribute("title", title); urlElement.AddAttribute("text", text); return(urlElement.ToString()); }
public static void CreateInput(string type, string name, string value) { ElementBuilder input = new ElementBuilder("input"); input.AddAttribute("type", type); input.AddAttribute("name", name); input.AddAttribute("value", value); Console.WriteLine(input); }
public static void CreateURL(string url, string title, string text) { ElementBuilder link = new ElementBuilder("a"); link.AddAttribute("href", url); link.AddAttribute("title", title); link.AddContent(text); Console.WriteLine(link); }
public static void CreateImage(string imgSource, string alt, string title) { ElementBuilder img = new ElementBuilder("img"); img.AddAttribute("source", imgSource); img.AddAttribute("alt", alt); img.AddAttribute("title", title); Console.WriteLine(img); }
static void Main(string[] args) { ElementBuilder element = new ElementBuilder("div"); element.AddAttribute("id", "page"); element.AddAttribute("class", "big"); element.AddContent("<p>Hello</p>"); Console.WriteLine(element * 2); HTMLDispatcher.CreateImage("../../../Sottuni.jpeg", "QQWW3", "Softuni"); Console.WriteLine(); HTMLDispatcher.CreateURL("www.softuni.bg", "The best University", "SoftUni"); Console.WriteLine(); HTMLDispatcher.CreateInput("submit", "Submit", "Send"); }
static void Main() { var div = new ElementBuilder("div"); div.AddAttribute("id", "page"); div.AddAttribute("class", "big"); div.AddContent("<p>Hello</p>"); Console.WriteLine(div * 3); Console.WriteLine(); var p = new ElementBuilder("p"); p.AddAttribute("style", "font-size: 5px;"); Console.WriteLine(p); Console.WriteLine(); p.AddContent("This is a paragraph"); Console.WriteLine(p); Console.WriteLine(); Console.WriteLine(p * 15); Console.WriteLine(); var image = HTMLDispatcher.CreateImage(@"http://www.google.bg", "missing", "Google"); Console.WriteLine(image); Console.WriteLine(); var link = HTMLDispatcher.CreateURL(@"https://facebook.com", "Facebook", "Click me!"); Console.WriteLine(link); Console.WriteLine(); var input = HTMLDispatcher.CreateInput("radio", "gender", "0"); Console.WriteLine(input); Console.WriteLine(); }
static void Main() { ElementBuilder div = new ElementBuilder("div"); div.AddAttribute("id", "page"); div.AddAttribute("class", "big"); div.AddAttribute("style", "background-color: pink; border-bottom: 5px solid black; margin: auto; width: 200px"); div.AddContent("<p>Hello</p>"); Console.WriteLine(div * 2); string image = HTMLDispatcher.CreateImage("/cat.png", "cat", "Cat"); string url = HTMLDispatcher.CreateURL("http://www.someurl.com", "some url", "some text"); string input = HTMLDispatcher.CreateInput("field", "Name", "Some Name"); Console.WriteLine(div); Console.WriteLine(image); Console.WriteLine(url); Console.WriteLine(input); using (StreamWriter sw = new StreamWriter("index.html")) { sw.WriteLine(div); } }