Пример #1
0
        public static string CreateInput(string inputType, string name, string value)
        {
            ElementBuilder input = new ElementBuilder("input");

            input.AddAtribute("type", inputType);
            input.AddAtribute("name", name);
            input.AddAtribute("value", value);
            return(input.ToString());
        }
Пример #2
0
        public static string CreateImage(string source, string alt, string title)
        {
            ElementBuilder image = new ElementBuilder("img");

            image.AddAtribute("src", source);
            image.AddAtribute("alt", alt);
            image.AddAtribute("title", title);
            return(image.ToString());
        }
Пример #3
0
        public static string CreateURL(string href, string title, string text)
        {
            ElementBuilder url = new ElementBuilder("a");

            url.AddAtribute("href", href);
            url.AddAtribute("title", title);
            url.AddContent(text);
            return(url.ToString());
        }
Пример #4
0
        static void Main(string[] args)
        {
            ElementBuilder div = new ElementBuilder("div");

            div.AddAtribute("id", "page");
            div.AddAtribute("class", "big");
            div.AddContent("<p>Hello</p>");
            Console.WriteLine(div.ToString());

            ElementBuilder li = new ElementBuilder("li");

            Console.WriteLine(li * 4);
            Console.WriteLine(div * 2);

            string image = HTMLDispatcher.CreateImage("atlantic ocean.jpg", "Ocean", "Atlantic Ocean");

            Console.WriteLine(image);
            string url = HTMLDispatcher.CreateURL("https://softuni.bg/", "Softuni", "Software Univercity");

            Console.WriteLine(url);
            string input = HTMLDispatcher.CreateInput("submit", "Submit", "Login");

            Console.WriteLine(input);
        }