﻿namespace _05.HTMLDispatcher
    {
    public static class HTMLDispatcher
        {
        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();
            }

        public static string CreateURL(string url, string title, string text)
            {
            ElementBuilder urlElement = new ElementBuilder("a");

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

            return urlElement.ToString();
            }

        public static string CreateInput(string type, string alt, string value)
            {
            ElementBuilder input = new ElementBuilder("input");

            input.AddAttribute("type", type);
            input.AddAttribute("alt", alt);
            input.AddAttribute("value", value);

            return input.ToString();
            }
        }
    }
