static void Main()
 {
     var student = new Student("Dimcho", 25);
     student.OnPropertyChange += EventChanges;
     student.Name = "Gosho";
     student.Age = 19;
 }
 public static void Main()
 {
     var st = new Student("Videlin", 30);
     st.OnPropertyChange += EventChanges;
     st.Name = "Pesho";
     st.Name = "Videlin";
     st.Age = 18;
 }
 static void Main(string[] args)
 {
     Student student = new Student("Peter", 22);
     student.OnPropertyChange += (sender, eventArgs) =>
     {
         Console.WriteLine("Property changed: {0} (from {1} to {2})",
             eventArgs.PropName, eventArgs.PreviousData, eventArgs.NewData);
     };
     student.Name = "Maria";
     student.Age = 19;
 }
 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;
 }
Exemple #5
0
        static void Main()
        {
            Student rick = new Student("Rick", 60);
            rick.PropertyChanged += (sender, eventArgs) =>
            {
                Console.WriteLine("Property changed: {0} (from {1} to {2})",
                    eventArgs.PropertyName, eventArgs.OldValue, eventArgs.NewValue);
            };

            rick.Name = "Morty";
            rick.Age = 14;
        }