当前位置: 首页>>代码示例>>C#>>正文


C# Student.ClearComments方法代码示例

本文整理汇总了C#中School.Student.ClearComments方法的典型用法代码示例。如果您正苦于以下问题:C# Student.ClearComments方法的具体用法?C# Student.ClearComments怎么用?C# Student.ClearComments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在School.Student的用法示例。


在下文中一共展示了Student.ClearComments方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

        static void Main(string[] args)
        {
            Student student1 = new Student("Kiril", 13);
            student1.AddComment("Test comment1 for student 1");
            student1.AddComment("Test comment2 for student 1");

            Student student2 = new Student("Vasil", 25);
            student2.AddComment("Test comment1 for student 2");
            student2.AddComment("Test comment2 for student 2");

            student1.RemoveComment("Test comment1 for student 1");
            student1.DisplayComments();

            student2.ClearComments();
            student2.DisplayComments();

            student1.AddComment("Blah blah");
            Console.WriteLine(student1.CommentsCount);
            student1.RemoveCommentAt(0);
            student1.DisplayComments();

            Discipline discipline1 = new Discipline("Discrete Mathematics", 1, 1);
            Discipline discipline2 = new Discipline("Mathematical Analysis", 1, 1);
            Discipline discipline3 = new Discipline("OOP", 2, 3);

            discipline1.AddComment("Introduction do discrete data structures.");
            discipline3.AddComment("Object Oriented Programming in C#");

            Teacher teacher1 = new Teacher("Trifon",
                new List<Discipline>() { discipline1 });

            Teacher teacher2 = new Teacher("Grigor",
                new List<Discipline>() { discipline2, discipline3 });

            Class class1 = new Class("312",
                new List<Teacher>() { teacher1, teacher2} ,
                new List<Student>() { student1, student2} );

            School school = new School(new List<Class>() { class1 });
        }
开发者ID:androidejl,项目名称:Telerik,代码行数:40,代码来源:Tester.cs


注:本文中的School.Student.ClearComments方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。