コード例 #1
0
        public static string CreateInput(string inputType, string name, string value)
        {
            ElementBuilder input = new ElementBuilder("input");
            input.AddAttribute("type", inputType);
            input.AddAttribute("name", name);
            input.AddAttribute("value",value);

            return input.ToString();
        }
コード例 #2
0
        public static string CreateUrl(string url, string title, string text)
        {
            ElementBuilder link = new ElementBuilder("a");
            link.AddAttribute("href", url);
            link.AddAttribute("title", title);
            link.AddContent(text);

            return link.ToString();
        }
コード例 #3
0
        public static string CreateImage(string imageSource, string alt, string title)
        {
            ElementBuilder image = new ElementBuilder("img");
            image.AddAttribute("src",imageSource);
            image.AddAttribute("alt",alt);
            image.AddAttribute("title",title);

            return imageSource.ToString();
        }
コード例 #4
0
        static void Main()
        {
            ElementBuilder div = new ElementBuilder("div");
            div.AddAttribute("id", "page");
            div.AddAttribute("class", "big");
            div.AddContent("<p>Hello</p>");
            Console.WriteLine(div * 2);

            Console.WriteLine(HTMLDispatcher.CreateImage("http://facebook.com/userimg.jpg", "UserImg", "Facebook"));
            Console.WriteLine(HTMLDispatcher.CreateUrl("http://facebook.com/", "Click", "Facebook"));
            Console.WriteLine(HTMLDispatcher.CreateInput("Button", "Register", "Click"));
        }