コード例 #1
0
 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();
 }
コード例 #2
0
 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();
 }
コード例 #3
0
 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();
 }
コード例 #4
0
        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());
        }
コード例 #5
0
        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());
        }
コード例 #6
0
        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());
        }
コード例 #7
0
ファイル: Test.cs プロジェクト: fetko1977/OOP-Homeworks
        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"));
        }
コード例 #8
0
ファイル: Test.cs プロジェクト: fetko1977/OOP-Homeworks
        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"));
        }