public static string CreateURL(string url, string title, string text)
 {
     ElementBuilder a = new ElementBuilder("a");
     a.AddAttr("href", url);
     a.AddAttr("title", title);
     a.AddContent(text);
     a.IsClosingTag(true);
     return a.ToString();
 }
 public static string CreateInput(string type, string name, string value)
 {
     ElementBuilder input = new ElementBuilder("input");
     input.AddAttr("type", type);
     input.AddAttr("name", name);
     input.AddAttr("value", value);
     input.IsClosingTag(false);
     return input.ToString();
 }
 public static string CreateImage(string src, string alt, string title)
 {
     ElementBuilder img = new ElementBuilder("img");
     img.AddAttr("src", src);
     img.AddAttr("alt", alt);
     img.AddAttr("title", title);
     img.IsClosingTag(false);
     return img.ToString();
 }
        public static string CreateInput(string type, string name, string value)
        {
            ElementBuilder input = new ElementBuilder("input");

            input.AddAttr("type", type);
            input.AddAttr("name", name);
            input.AddAttr("value", value);
            input.IsClosingTag(false);
            return(input.ToString());
        }
        public static string CreateURL(string url, string title, string text)
        {
            ElementBuilder a = new ElementBuilder("a");

            a.AddAttr("href", url);
            a.AddAttr("title", title);
            a.AddContent(text);
            a.IsClosingTag(true);
            return(a.ToString());
        }
        public static string CreateImage(string src, string alt, string title)
        {
            ElementBuilder img = new ElementBuilder("img");

            img.AddAttr("src", src);
            img.AddAttr("alt", alt);
            img.AddAttr("title", title);
            img.IsClosingTag(false);
            return(img.ToString());
        }
Example #7
0
        static void Main(string[] args)
        {
            ElementBuilder div = new ElementBuilder("div");
            div.AddAttr("id", "main");
            div.AddAttr("class", "left");
            div.AddContent("<p>This is my left div</p>");
            div.IsClosingTag(true);
            Console.WriteLine(div);
            Console.WriteLine(div * 2);
            Console.WriteLine();

            Console.WriteLine(HTMLDispatcher.CreateImage("fetko1977.jpg", "Svetoslav Savov", "Svetoslav Savov"));
            Console.WriteLine(HTMLDispatcher.CreateInput("text", "username", "fetko1977"));
            Console.WriteLine(HTMLDispatcher.CreateURL("http://www.softuni.bg", "Softuni", "Software University of Bulgaria"));
        }
Example #8
0
        static void Main(string[] args)
        {
            ElementBuilder div = new ElementBuilder("div");

            div.AddAttr("id", "main");
            div.AddAttr("class", "left");
            div.AddContent("<p>This is my left div</p>");
            div.IsClosingTag(true);
            Console.WriteLine(div);
            Console.WriteLine(div * 2);
            Console.WriteLine();

            Console.WriteLine(HTMLDispatcher.CreateImage("fetko1977.jpg", "Svetoslav Savov", "Svetoslav Savov"));
            Console.WriteLine(HTMLDispatcher.CreateInput("text", "username", "fetko1977"));
            Console.WriteLine(HTMLDispatcher.CreateURL("http://www.softuni.bg", "Softuni", "Software University of Bulgaria"));
        }