Exemplo n.º 1
0
 public void Add(int x)
 {
     total += x;
     if (total >= threshold)
     {
         ChatEventHandler handler = new ChatEventHandler()
         {
             SenderName   = senderName,
             ReceivedDate = DateTime.Now
         };
         OnThresholdReached(handler);
     }
 }
Exemplo n.º 2
0
 private static void c_ThresholdReached(object sender, ChatEventHandler e)
 {
     Console.WriteLine("The sender: {0} was sended at {1} ", e.SenderName, e.ReceivedDate);
     Environment.Exit(0);
 }
Exemplo n.º 3
0
 private void OnThresholdReached(ChatEventHandler handler)
 {
     ThresholdReached?.Invoke(this, handler);
 }