ToString() public method

public ToString ( ) : string
return string
コード例 #1
0
        static void Main()
        {
            LocalCourse localCourse = new LocalCourse("Databases");

            Console.WriteLine(localCourse.ToString());

            localCourse.Lab = "Enterprise";
            Console.WriteLine(localCourse.ToString());

            localCourse.Students = new List <string>()
            {
                "Peter", "Maria"
            };
            Console.WriteLine(localCourse.ToString());

            localCourse.TeacherName = "Svetlin Nakov";
            localCourse.Students.Add("Milena");
            localCourse.Students.Add("Todor");
            Console.WriteLine(localCourse.ToString());

            OffsiteCourse offsiteCourse = new OffsiteCourse(
                "PHP and WordPress Development", "Mario Peshev",
                new List <string>()
            {
                "Thomas", "Ani", "Steve"
            });

            Console.WriteLine(offsiteCourse.ToString());
        }
コード例 #2
0
       static void Main()
       {
           LocalCourse localCourse = new LocalCourse("Databases");
           Console.WriteLine(localCourse.ToString());

           localCourse.Lab = "Enterprise";
           Console.WriteLine(localCourse.ToString());

           localCourse.Students = new List<string>() { "Peter", "Maria" };
           Console.WriteLine(localCourse.ToString());

           localCourse.TeacherName = "Svetlin Nakov";
           localCourse.Students.Add("Milena");
           localCourse.Students.Add("Todor");
           Console.WriteLine(localCourse.ToString());

           OffsiteCourse offsiteCourse = new OffsiteCourse(
               "PHP and WordPress Development",
               "Mario Peshev",
               new List<string>()
                   {
                       "Thomas", 
                       "Ani", 
                       "Steve"
                   });
           Console.WriteLine(offsiteCourse.ToString());
       }
コード例 #3
0
        public static void Main()
        {
            OffsiteCourse offsiteCourse = new OffsiteCourse(
                "C#",
                "Nakov",
                new List<string>() { "Thomas", "Ani", "Steve" },
                "Sofiq");

            LocalCourse localCourse = new LocalCourse(
                "C#",
                "Nakov",
                new List<string>() { "Gosho", "Pesho", "Rambo" },
                "light");

            Console.WriteLine(offsiteCourse.ToString());
            Console.WriteLine(localCourse.ToString());
        }
コード例 #4
0
ファイル: CoursesExamples.cs プロジェクト: stoyans/Telerik
        public static void Main()
        {
            LocalCourse localCourse = new LocalCourse("Database", "Svetlin Nakov", new List<string>() { "Peter", "Maria", "Milena", "Todor" }, "Enterprise");
            Console.WriteLine(localCourse.ToString());

            OffsiteCourse offsiteCourse = new OffsiteCourse("PHP and WordPress Development", "Mario Peshev", new List<string>() { "Thomas", "Ani", "Steve" }, "Sofia");
            Console.WriteLine(offsiteCourse);

            List<Course> courses = new List<Course>();
            courses.Add(localCourse);
            courses.Add(offsiteCourse);

            foreach (var course in courses)
            {
                Console.WriteLine(course.Name);
            }
        }