Пример #1
0
        public static string CreateInput(string type, string name, string value)
        {
            ElementBuilder image = new ElementBuilder("a");
            image.AddAttribute("type", type);
            image.AddAttribute("name", name);
            image.AddAttribute("value", value);

            return image.ToString();
        }
Пример #2
0
        public static string CreateURL(string url, string text, string title)
        {
            ElementBuilder image = new ElementBuilder("a");
            image.AddAttribute("url", url);
            image.AddContent(text);
            image.AddAttribute("title", title);

            return image.ToString();
        }
Пример #3
0
        public static string CreateImage(string source, string alt, string title)
        {
            ElementBuilder image = new ElementBuilder("img");
            image.AddAttribute("src", source);
            image.AddAttribute("alt", alt);
            image.AddAttribute("title", title);

            return image.ToString();
        }
        static void Main(string[] args)
        {
            ElementBuilder build = new ElementBuilder("div");
            build.AddAttribute("font", "Ariel");
            build.AddContent("HomePage!");
            Console.WriteLine(build * 3);
            Console.WriteLine();

            Console.WriteLine(HTMLDispatcher.CreateImage("picture.jpg", "this is my image", "The image"));
            Console.WriteLine(HTMLDispatcher.CreateURL("www.softuni.bg", "softuni's homepage", "softuni.bg"));
            Console.WriteLine(HTMLDispatcher.CreateInput("submit", "Submit button", "Click me!"));
        }