Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 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();
 }
Exemplo n.º 3
0
 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();
 }
Exemplo n.º 4
0
        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());
        }
Exemplo n.º 5
0
        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());
        }
Exemplo n.º 6
0
        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();
        }