コード例 #1
0
ファイル: Program.cs プロジェクト: MahbubAhmedTonmoy/CSharp
 public void Add(int x)
 {
     total += x;
     if (total >= threshold)
     {
         ThresholdReachedEventArgs args = new ThresholdReachedEventArgs();
         args.Threshold   = threshold;
         args.TimeReached = DateTime.Now;
         OnThresholdReached(args);
     }
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: MahbubAhmedTonmoy/CSharp
 static void c_ThresholdReached(object sender, ThresholdReachedEventArgs e)
 {
     Console.WriteLine("The threshold was reached.{0}---{1}", e.Threshold, e.TimeReached);
     Environment.Exit(0);
 }