예제 #1
0
        public 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();

            ElementBuilder li = new ElementBuilder("li");

            li.AddAttribute("class", "nav");
            li.AddAttribute("id", "one");
            li.AddContent("Hello OOP");

            Console.WriteLine(li * 3);
            Console.WriteLine();

            string image = HTMLDispatcher.CreateImage("img.png", "sample img", "sample");
            string url = HTMLDispatcher.CreateURL("https:\\\\softuni.bg", "SoftUni", "SoftUni website");
            string input = HTMLDispatcher.CreateInput("text", "username", "student");

            Console.WriteLine(image);
            Console.WriteLine(url);
            Console.WriteLine(input);
        }
 public string CreateURL(string url, string title, string text)
 {
     ElementBuilder image = new ElementBuilder("URL");
     image.AddAttribute("href", url);
     image.AddAttribute("title", title);
     image.AddAttribute("text", text);
     return image.ToString();
 }
 public string CreateInput(string inputType, string name, string value)
 {
     ElementBuilder image = new ElementBuilder("input");
     image.AddAttribute("input", inputType);
     image.AddAttribute("name", name);
     image.AddAttribute("value", value);
     return image.ToString();
 }
 public 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 image.ToString();
 }
예제 #5
0
        static void Main(string[] args)
        {
            ElementBuilder div = new ElementBuilder("div");

            div.AddAttribute("id", "page");
            div.AddAttribute("class", "big");
            div.AddContent("<p>Hello</p>");
            //Console.WriteLine(div * 2);
        }
예제 #6
0
        public static string CreateHyperlink(string url, string title, string text)
        {
            ElementBuilder hyperlink = new ElementBuilder("a");

            hyperlink.AddAttribute("url", url);
            hyperlink.AddAttribute("title", title);
            hyperlink.AddContent(text);
            return(hyperlink.ToString());
        }
예제 #7
0
        public static ElementBuilder CreateInput(string type = "button", string name = "name", string value = "")
        {
            ElementBuilder input = new ElementBuilder("input");
            input.AddAttribute("type", type);
            input.AddAttribute("name", name);
            input.AddAttribute("value", value);

            return input;
        }
예제 #8
0
        public static string CreateInput(string inputType, string nameValue, string titleValue)
        {
            ElementBuilder input = new ElementBuilder("input");

            input.AddAttribute("name", nameValue);
            input.AddAttribute("title", titleValue);

            return(input.ToString());
        }
예제 #9
0
        public static string CreateDiv(string id, string style, string content)
        {
            ElementBuilder div = new ElementBuilder("div");

            div.AddAttribute("id", id);
            div.AddAttribute("style", style);
            div.AddContent(content);
            return(div.ToString());
        }
예제 #10
0
        static void Main(string[] args)
        {
            ElementBuilder div = new ElementBuilder("div");
            div.AddAttribute("id", "page");
            div.AddAttribute("class", "big");
            div.AddContent("<p>Hello</p>");
            //Console.WriteLine(div * 2);

        }
예제 #11
0
        public static string CreateInput(string type, string name, string value)
        {
            ElementBuilder input = new ElementBuilder("input");
            input.AddAtributes("type", type);
            input.AddAtributes("name", name);
            input.AddAtributes("value", value);

            return input.ToString();
        }
예제 #12
0
        public static string CreateURL(string url, string title, string text)
        {
            ElementBuilder a = new ElementBuilder("a");
            a.AddAtributes("href", url);
            a.AddAtributes("title", title);
            a.AddContent(text);

            return a.ToString();
        }
예제 #13
0
 static void Main(string[] args)
 {
     ElementBuilder element = new ElementBuilder("div");
     element.AddAttribute("id", "page");
     element.AddAttribute("class", "big");
     element.AddContent("<p>Hello</p>");
     Console.WriteLine(element);
     Console.WriteLine(element * 2);
 }
예제 #14
0
        public static ElementBuilder 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;
        }
예제 #15
0
        public static string CreateImage(string imgSrc, string alt, string title)
        {
            ElementBuilder img = new ElementBuilder("img", true);

            img.AddAttribute("src", imgSrc);
            img.AddAttribute("alt", alt);
            img.AddAttribute("title", title);
            return(img.ToString());
        }
예제 #16
0
        public static ElementBuilder CreateImage(string src, string alt, string title)
        {
            ElementBuilder image = new ElementBuilder("img", true);

            image.AddAttribute("src", src);
            image.AddAttribute("alt", alt);
            image.AddAttribute("title", title);

            return(image);
        }
예제 #17
0
        public static ElementBuilder CreateInput(string type, string name, string value)
        {
            ElementBuilder input = new ElementBuilder("input", true);

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

            return(input);
        }
예제 #18
0
        public static ElementBuilder CreateURL(string url, string title, string text)
        {
            ElementBuilder urlTag = new ElementBuilder("a");

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

            return(urlTag);
        }
예제 #19
0
        public static string CreateURL(string hrefValue, string titleValue, string content)
        {
            ElementBuilder anchor = new ElementBuilder("a");

            anchor.AddAttribute("href", hrefValue);
            anchor.AddAttribute("title", titleValue);
            anchor.AddContent(content);

            return(anchor.ToString());
        }
        public static string CreateInput(string inputType, string name, string value)
        {
            ElementBuilder e = new ElementBuilder("input");

            e.AddAttribute("type", inputType);
            e.AddAttribute("name", name);
            e.AddAttribute("value", value);

            return(e.ToString());
        }
예제 #21
0
        public static ElementBuilder CreateImage(string src, string alt, string title)
        {
            ElementBuilder image = new ElementBuilder("img", true);

            image.AddAttribute("src", src);
            image.AddAttribute("alt", alt);
            image.AddAttribute("title", title);

            return image;
        }
        public static string CreateURL(string url, string title, string text)
        {
            ElementBuilder e = new ElementBuilder("a");

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

            return(e.ToString());
        }
예제 #23
0
        static void Main(string[] args)
        {
            ElementBuilder element = new ElementBuilder("div");

            element.AddAttribute("id", "page");
            element.AddAttribute("class", "big");
            element.AddContent("<p>Hello</p>");
            Console.WriteLine(element);
            Console.WriteLine(element * 2);
        }
예제 #24
0
        public static ElementBuilder CreateURL(string url, string title, string text)
        {
            ElementBuilder urlTag = new ElementBuilder("a");

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

            return urlTag;
        }
예제 #25
0
        public static string CreateImage(string srcValue, string altValue, string titleValue)
        {
            ElementBuilder img = new ElementBuilder("img");

            img.AddAttribute("src", srcValue);
            img.AddAttribute("alt", altValue);
            img.AddAttribute("title", titleValue);

            return(img.ToString());
        }
예제 #26
0
 static void Main(string[] args)
 {
     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("abv.bg", "abv"));
     Console.WriteLine(HTMLDispatcher.CreateUrl("abv.bg", "abv", "go to abv"));
     Console.WriteLine(HTMLDispatcher.CreateInput());
 }
예제 #27
0
        public static ElementBuilder CreateImage(string imageSource, string alt, string title = null)
        {
            ElementBuilder image = new ElementBuilder("img");
            image.AddAttribute("src", imageSource);
            image.AddAttribute("alt", alt);
            if (title != null)
            {
                image.AddAttribute("title", title);
            }

            return image;
        }
        public static string CreateImage(string imagSource, string alt, string title)
        {
            ElementBuilder element = new ElementBuilder("img");

            element.AddAttribute("src", imagSource);

            element.AddAttribute("alt", alt);

            element.AddAttribute("title", title);

            return(element.ToString());
        }
        public static string CreateImage(string imagSource, string alt, string title)
        {
            ElementBuilder element = new ElementBuilder("img");

            element.AddAttribute("src", imagSource);

            element.AddAttribute("alt", alt);

            element.AddAttribute("title", title);

            return element.ToString();
        }
예제 #30
0
파일: Tests.cs 프로젝트: premiera85/SoftUni
        static void Main(string[] args)
        {
            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("abv.bg", "abv"));
            Console.WriteLine(HTMLDispatcher.CreateUrl("abv.bg", "abv", "go to abv"));
            Console.WriteLine(HTMLDispatcher.CreateInput());
        }
예제 #31
0
 static void Main()
 {
     ElementBuilder b = new ElementBuilder("b");
     //div.Attributes.Add("id", "header");
     Console.WriteLine(b);
     Console.WriteLine(b*2);
     b.AddAttributes("id", "header");
     Console.WriteLine(b);
     b.AddAttributes("class", "menu");
     Console.WriteLine(b);
     b.AddContent("Text");
     Console.WriteLine(b);
 }
예제 #32
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();
            Console.WriteLine(CreateImage("smiley.gif", "Smiley face", "Project 101"));
            Console.WriteLine(CreateURL("http://softuni.bg", "SoftUni hyperlink", "Better education"));
            Console.WriteLine(CreateInput("text", "fname", "Input tag"));
        }
예제 #33
0
        public 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();

            Console.WriteLine(HTMLDispatcher.CreateImage("MyDocuments/Pictures", "Beach", "California"));
            Console.WriteLine(HTMLDispatcher.CreateURL("www.metallica.com", "Metallica", "Official Metallica Website"));
            Console.WriteLine(HTMLDispatcher.CreateInput("button", "login", "Enter"));
        }
예제 #34
0
        static void Main()
        {
            ElementBuilder div = new ElementBuilder("div");

            div.AddElement("id", "page");
            div.AddElement("class", "big");
            div.AddContent("<p>Hello</p>");
            Console.WriteLine(div * 2);

            Console.WriteLine();

            Console.WriteLine(HTMLDispatcher.CreateImage("D:\\Picture\\image.jpg", "Preview not available", "Snimka"));
            Console.WriteLine(HTMLDispatcher.CreateInput("text", "inputText", "This is some text"));
            Console.WriteLine(HTMLDispatcher.CreateURL("www.abv.bg", "ABV mail", "Some text"));
        }
예제 #35
0
        public 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();

            Console.WriteLine(HTMLDispatcher.CreateImage("MyDocuments/Pictures", "Beach", "California"));
            Console.WriteLine(HTMLDispatcher.CreateURL("www.metallica.com", "Metallica", "Official Metallica Website"));
            Console.WriteLine(HTMLDispatcher.CreateInput("button", "login", "Enter"));
        }
예제 #36
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("https://softuni.bg/Content/images/software-university-logo.png",
                "SoftUni Logo", "THIS ... IS ... SOFTWARE UNIVERSITYYYYYY !!!!"));
            Console.WriteLine();

            string url = HTMLDispatcher.CreateURL("https://softuni.bg/", "SoftUni website", "Welcome to SoftUni");
            Console.WriteLine(url);
            Console.WriteLine();

            Console.WriteLine(HTMLDispatcher.CreateInput("comment", "StudentComment", "Enter your comment here"));
        }
예제 #37
0
        static void Main(string[] args)
        {
            ElementBuilder div = new ElementBuilder("div");
            div.AddAttribute("id", "page");
            div.AddAttribute("class", "big");
            div.AddContent("<p>Hello</p>");

            Console.WriteLine(div);
            Console.WriteLine();
            Console.WriteLine(div * 2);
            Console.WriteLine();

            ElementBuilder image = HTMLDispatcher.CreateImage("https://softuni.bg/Content/design/logo.png", "Software University", "Software University");
            ElementBuilder url = HTMLDispatcher.CreateURL("https://softuni.bg", "Software University", "SoftUni");
            ElementBuilder input = HTMLDispatcher.CreateInput("text", "name", "1");

            Console.WriteLine(image);
            Console.WriteLine(url);
            Console.WriteLine(input);
        }
예제 #38
0
        static void Main(string[] args)
        {
            ElementBuilder div = new ElementBuilder("div");
            ElementBuilder a = new ElementBuilder("a");
            ElementBuilder li = new ElementBuilder("li");

            div.AddAtributes("class", "softuni");
            div.AddAtributes("onclick", "highlight();");

            a.AddAtributes("href", "http://softuni.bg");
            a.AddContent("Software University");
            div.AddContent(a.ToString());

            Console.WriteLine(div);

            Console.WriteLine(li * 2);

            Console.WriteLine(HTMLDispatcher.CreateImage("http://softuni.bg/img/logo.png", "softuni-logo", "logo"));
            Console.WriteLine(HTMLDispatcher.CreateURL("http://softuni.bg", "Software University", "The best university in Bulgaria"));
            Console.WriteLine(HTMLDispatcher.CreateInput("text", "address", "Sofia bul. Vasil Kynchew 26"));
        }
        public 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();


            ElementBuilder li = new ElementBuilder("li");

            li.AddAttribute("class", "nav");

            li.AddAttribute("id", "one");

            li.AddContent("Hello OOP");


            Console.WriteLine(li * 3);

            Console.WriteLine();

            string image = HTMLDispatcher.CreateImage("img.png", "sample img", "sample");

            string url = HTMLDispatcher.CreateURL("https:\\\\softuni.bg", "SoftUni", "SoftUni website");

            string input = HTMLDispatcher.CreateInput("text", "username", "student");

            Console.WriteLine(image);

            Console.WriteLine(url);

            Console.WriteLine(input);
        }
예제 #40
0
        static void Main(string[] args)
        {
            ElementBuilder div = new ElementBuilder("div");

            div.AddAttribute("id", "page");
            div.AddAttribute("class", "big");
            div.AddContent("<p>Hello</p>");

            Console.WriteLine(div);
            Console.WriteLine();
            Console.WriteLine(div * 2);
            Console.WriteLine();


            ElementBuilder image = HTMLDispatcher.CreateImage("https://softuni.bg/Content/design/logo.png", "Software University", "Software University");
            ElementBuilder url   = HTMLDispatcher.CreateURL("https://softuni.bg", "Software University", "SoftUni");
            ElementBuilder input = HTMLDispatcher.CreateInput("text", "name", "1");

            Console.WriteLine(image);
            Console.WriteLine(url);
            Console.WriteLine(input);
        }
예제 #41
0
파일: TestProgram.cs 프로젝트: dpetrova/OOP
        static void Main()
        {
            //test html element builder
            ElementBuilder div = new ElementBuilder("div");

            div.AddAttribute("id", "page");
            div.AddAttribute("class", "big");
            div.AddContent("<p>Hello</p>");
            div.IsSelfClosed = false;
            Console.WriteLine(div * 2);


            //test html dispatcher
            string myImage = HTMLDispatcher.CreateImage("image1.jpg", "test image", "test image");

            Console.WriteLine(myImage);
            string myLink = HTMLDispatcher.CreateURL("http://www.softuni.bg", "www.softuni.bg", "www.softuni.bg");

            Console.WriteLine(myLink);
            string myInput = HTMLDispatcher.CreateInput("submit", "submit", "Submit");

            Console.WriteLine(myInput);
        }
예제 #42
0
 public static ElementBuilder operator *(ElementBuilder currentElement, int count)
 {
     if (count < 1)
     {
         throw new ArgumentOutOfRangeException("Value for repeat must be at least 1 or greater.");
     }
     var newElement = new ElementBuilder(currentElement.Tag)
     {
         Attributes = currentElement.Attributes,
         Content = currentElement.Content
     };
     newElement.Repeat *= count;
     newElement.IsSelfClosingTag = currentElement.IsSelfClosingTag;
     return newElement;
 }