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);
        }
Exemple #2
0
        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);
        }
 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;
 }
 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;
 }
 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;
 }
        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);
        }
        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);
        }
        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);
        }
        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());
        }
        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());
        }
        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());
        }
Exemple #12
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"));
        }