コード例 #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);
        }
コード例 #2
0
 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();
 }
コード例 #3
0
 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();
 }
コード例 #4
0
 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
ファイル: DispatcherMain.cs プロジェクト: bangush/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);
        }
コード例 #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
ファイル: ElementBuilder.cs プロジェクト: VyaraGGeorgieva/OOP
        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
ファイル: HTMLDispatcher.cs プロジェクト: ialidzhikov/SoftUni
        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
ファイル: DispatcherMain.cs プロジェクト: zhecho1215/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);

        }
コード例 #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
ファイル: TestHTML.cs プロジェクト: zhecho1215/HomeWorks
 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
ファイル: ElementBuilder.cs プロジェクト: VyaraGGeorgieva/OOP
        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
ファイル: HTMLDispatcher.cs プロジェクト: ialidzhikov/SoftUni
        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());
        }
コード例 #20
0
        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;
        }
コード例 #22
0
        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
ファイル: HTMLDispatcher.cs プロジェクト: ialidzhikov/SoftUni
        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
ファイル: ElementBuilder.cs プロジェクト: VyaraGGeorgieva/OOP
        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;
        }
コード例 #28
0
        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());
        }
コード例 #29
0
        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
ファイル: HTMLDispatcher.cs プロジェクト: mkmirchev/OOP
 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
ファイル: HTMLDispatcher.cs プロジェクト: ialidzhikov/SoftUni
        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
ファイル: Dispatch.cs プロジェクト: nadiahristova/OOP
        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
ファイル: Dispatch.cs プロジェクト: nadiahristova/SoftUni
        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
ファイル: DispatcherRun.cs プロジェクト: Dochko/SoftUni
        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
ファイル: HTMLBuilder.cs プロジェクト: BAleksiev/OOP-Course
        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
ファイル: MainClass.cs プロジェクト: AdrianDamyanov/CSharpOOP
        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"));
        }
コード例 #39
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);
        }
コード例 #40
0
ファイル: HTMLBuilder.cs プロジェクト: BAleksiev/OOP-Course
        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
ファイル: ElementBuilder.cs プロジェクト: mkmirchev/OOP
 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;
 }