Example #1
0
        protected virtual void OnNameReached(NameReachedEventArgs e)
        {
            EventHandler <NameReachedEventArgs> handler = NameReached;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Example #2
0
 public void Add(int x)
 {
     total += x;
     if (total > threshold)
     {
         NameReachedEventArgs args1 = new NameReachedEventArgs();
         args1.Name    = "Diana";
         args1.Surname = "Zheltok";
         OnNameReached(args1);
     }
     if (total == threshold)
     {
         ThresholdReachedEventArgs args = new ThresholdReachedEventArgs();
         args.Threshold   = threshold;
         args.TimeReached = DateTime.Now;
         OnThresholdReached(args);
     }
 }
Example #3
0
 static void c_NameReached(object sender, NameReachedEventArgs e)
 {
     Console.WriteLine("I am {0}  {1}.", e.Name, e.Surname);
 }