コード例 #1
0
 public static void Main()
 {
     var student = new Student("Koko", 19);
     student.OnChange += EventChanges;
     student.Name = "Milko";
     student.Age = 21;
 }
コード例 #2
0
ファイル: TestStudent.cs プロジェクト: pavelilchev/HomeWorks
        static void Main(string[] args)
        {
            Student student = new Student("Peter", 22);

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

            student.Name = "Maria";
            student.Age = 19;
        }