Example #1
0
 // The method which fires the Event
 public void OnPropertyChange(object sender, PropertyChangeEventArgs data)
 {
     // Check if there are any Subscribers
     if (PropertyChange != null)
     {
         // Call the Event
         PropertyChange(this, data);
     }
 }
Example #2
0
 public static void PropertyHasChanged(object sender, PropertyChangeEventArgs data)
 {
     Console.SetWindowSize(10, 7);
     if (data.NewValue > 0 && data.NewValue < 5)
     {
         Console.Beep();
         Console.Clear();
     }
     else if (data.NewValue > 5)
     {
         Console.Beep(700, 500);
         Console.Clear();
         Program.Product.Sweetness = 5;
     }
     else if (data.NewValue < 0)
     {
         Console.Beep(700, 500);
         Console.Clear();
         Program.Product.Sweetness = 0;
     }
     else if (data.NewValue == 0 || data.NewValue == 5)
     {
         Console.Clear();
     }
 }