static void Main()
        {
            ElementBuilder testElement = new ElementBuilder("a");
            Console.WriteLine(5 * testElement);
            testElement.AddAttribute("href", "softuni.bg");
            testElement.AddAttribute("class", "links");
            testElement.AddContent("Click here");
            Console.WriteLine(testElement);

            Console.WriteLine();

            ElementBuilder div = new ElementBuilder("div");
            div.AddAttribute("id", "page");
            div.AddAttribute("class", "big");
            div.AddContent("<p>Hello</p>");
            Console.WriteLine(div * 2);

            Console.WriteLine();

            ElementBuilder img = HTMLDispatcher.CreateImage("localhost/kartinka.png", "nicePic", "this is the picture");
            Console.WriteLine(img);
            ElementBuilder url = HTMLDispatcher.CreateURL("gosho.bg", "gosheto", "Go to link");
            Console.WriteLine(url);
            ElementBuilder input = HTMLDispatcher.CreateInput("text", "input", "empty");
            Console.WriteLine(input);
        }
Ejemplo n.º 2
0
 public static ElementBuilder CreateInput(string type, string name, string value)
 {
     ElementBuilder result = new ElementBuilder("input", true);
     result.AddAttribute("type", type);
     result.AddAttribute("name", name);
     result.AddAttribute("value", value);
     return result;
 }
Ejemplo n.º 3
0
 public static ElementBuilder CreateImage(string source, string alt, string title)
 {
     ElementBuilder result = new ElementBuilder("img", true);
     result.AddAttribute("src", source);
     result.AddAttribute("alt", alt);
     result.AddAttribute("title", title);
     return result;
 }
Ejemplo n.º 4
0
 public static ElementBuilder CreateURL(string url, string title, string text)
 {
     ElementBuilder result = new ElementBuilder("a");
     result.AddContent(text);
     result.AddAttribute("title", title);
     result.AddAttribute("href", url);
     return result;
 }
Ejemplo n.º 5
0
        public static ElementBuilder CreateImage(string source, string alt, string title)
        {
            ElementBuilder result = new ElementBuilder("img", true);

            result.AddAttribute("src", source);
            result.AddAttribute("alt", alt);
            result.AddAttribute("title", title);
            return(result);
        }
Ejemplo n.º 6
0
        public static ElementBuilder CreateInput(string type, string name, string value)
        {
            ElementBuilder result = new ElementBuilder("input", true);

            result.AddAttribute("type", type);
            result.AddAttribute("name", name);
            result.AddAttribute("value", value);
            return(result);
        }
Ejemplo n.º 7
0
        public static ElementBuilder CreateURL(string url, string title, string text)
        {
            ElementBuilder result = new ElementBuilder("a");

            result.AddContent(text);
            result.AddAttribute("title", title);
            result.AddAttribute("href", url);
            return(result);
        }
Ejemplo n.º 8
0
        public static string CreateInput(string inputType, string name, string value)
        {
            ElementBuilder newInput = new ElementBuilder("input");

            newInput.AddAttribute("type", inputType);
            newInput.AddAttribute("name", name);
            newInput.AddAttribute("value", value);

            return(newInput.ToString());
        }
Ejemplo n.º 9
0
        public static string CreateURL(string url, string title, string text)
        {
            ElementBuilder newURL = new ElementBuilder("a");

            newURL.AddAttribute("href", url);
            newURL.AddAttribute("title", title);
            newURL.AddContent(text);

            return(newURL.ToString());
        }
Ejemplo n.º 10
0
        public static string CreateImage(string imageSource, string alt, string title)
        {
            ElementBuilder newImage = new ElementBuilder("img");

            newImage.AddAttribute("src", imageSource);
            newImage.AddAttribute("alt", alt);
            newImage.AddAttribute("title", title);

            return(newImage.ToString());
        }
Ejemplo n.º 11
0
        static void Main(string[] args)
        {
            ElementBuilder div = new ElementBuilder("div");

            div.AddAttribute("id", "page");
            div.AddAttribute("class", "big");
            div.AddContent("<p>Hello</p>");
            Console.WriteLine(div * 5);

            Console.WriteLine();
            Console.WriteLine(HTMLDispatcher.CreateImage("smiley.gif", "Smiley face", "Smiley title"));

            Console.WriteLine();
            Console.WriteLine(HTMLDispatcher.CreateURL("https://softuni.bg", "SoftUni", "Software University"));

            Console.WriteLine();
            Console.WriteLine(HTMLDispatcher.CreateInput("submit", "submitButton", "OK"));
        }