Пример #1
0
        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);
            }
        }
Пример #2
0
        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();
        }