Exemple #1
0
 public void SetTemperature(int temperature)
 {
     if (temperature >= this.HighTemperature)
     {
         FireHandler?.Invoke(this, new FireEventArgs()
         {
             CurrentTemperature = temperature,
             HighestTemperature = this.HighTemperature
         }
                             );// can only invoke in current class
     }
     else
     {
         Console.WriteLine("normal temperature");
     }
 }
Exemple #2
0
 protected void EventInvoke(FireEventArgs fireEventArgs)
 {
     // can only invoke in current class,(FireHandler in abstractPerform)
     // so build this method to be used by derived class
     FireHandler?.Invoke(this, fireEventArgs);
 }