Example #1
0
        public static void Main()
        {
            Student firstStudent = new Student("Asq", "Asenova", "Becheva", 45845874, "Plovdiv ul.Some street address",
                "0898556677", "*****@*****.**", 1, Specialty.Mathematics, Faculty.Mathematics, University.PU);

            Student secondStudent = new Student("Stefka", "Slavcheva", "Slaveikova", 14523698, "Sofia ul.Some street address",
                "0877758954", "*****@*****.**", 3, Specialty.Marketing, Faculty.Economics, University.KIA);

            Console.WriteLine("*** Students ***");
            Console.WriteLine(firstStudent + "\n");
            Console.WriteLine(secondStudent);

            Console.WriteLine("\n*** Deep cloning ***");
            var clonedStudent = firstStudent.Clone();
            Console.WriteLine(clonedStudent);

            Console.WriteLine("\n\n*** Method Equals() ***");
            Console.WriteLine(firstStudent.Equals(secondStudent));

            Console.WriteLine("\n\n*** Operator == ***");
            Console.WriteLine(firstStudent == secondStudent);

            Console.WriteLine("\n\n*** Operator != ***");
            Console.WriteLine(firstStudent != secondStudent);

            Console.WriteLine("\n\n*** Method CompareTo ***");
            Console.WriteLine(firstStudent.CompareTo(secondStudent));
        }
Example #2
0
 static void Main(string[] args)
 {
     Student myStudent = new Student();
     //  Console.WriteLine(myStudent.Name);
     // Console.WriteLine(myStudent.Course);
     //  Console.WriteLine(myStudent.Subject);
     //  Console.WriteLine(myStudent.University);
     // Console.WriteLine(myStudent.Email);
     //  Console.WriteLine(myStudent.PhoneNumber);
     myStudent.Info();
 }
Example #3
0
        static void Main(string[] args)
        {
            var student = new Student("Ogi", 100);

            student.OnPropertyChanged += PropertyHandler;

            student.Name = "Ivan";
            student.Age = 22;

            student.OnPropertyChanged -= PropertyHandler;

            student.OnPropertyChanged += (sender, eventArgs) =>
                {
                    Console.WriteLine(
                        "Property changed: {0} (from {1} to {2})",
                        eventArgs.PropertyName,
                        eventArgs.OldValue,
                        eventArgs.NewValue);
                };
            student.Name = "Maria";
            student.Age = 19;
        }