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

            element.AddAttribute("url", url);
            element.AddAttribute("title", title);
            element.AddContent(text);
            StringBuilder sb = new StringBuilder();

            sb.Append(element.ElementOpener);
            sb.Append(element.AttributeField + ">");
            sb.Append(element.ContentField);
            sb.Append(element.ElementCloser);
            return(sb.ToString());
        }
Exemple #2
0
        static void Main(string[] args)
        {
            //elemBuilder class test zone
            ElementBuilder hehe = new ElementBuilder("div");

            hehe.AddAttribute("id", "page");
            hehe.AddAttribute("class", "cenzura");
            hehe.AddContent("gaaasimu");
            //overloaded * operator
            Console.WriteLine(hehe * 2);

            //static classes
            Console.WriteLine(HTMLDispatcher.CreateImage("dir.bg", "404", "EmptyPillow"));
            Console.WriteLine(HTMLDispatcher.CreateURL("kaldata.bg", "shano site", "KALDATA.BG"));
            Console.WriteLine(HTMLDispatcher.CreateInput("text", "FirstName", "Gosho ot P."));
        }