Example #1
0
 void CheckResult()
 {
     if (Result < 0 || Result > 100)
     {
         EventHandler <RangeWarningEventArgs> handler = RangeWarning;
         if (handler != null)
         {
             RangeWarningEventArgs args = new RangeWarningEventArgs();
             args.Value = Result;
             handler(this, args);
         }
     }
 }
Example #2
0
 static void calc_RangeWarning(object sender, RangeWarningEventArgs e)
 {
     Console.WriteLine("The calculator value ({0}) is dangerous",
                       e.Value);
 }