コード例 #1
0
    protected override void OnCalculationPerformed(CalculationEventArgs args)
    {
        // perform custom logic here

        // call the base method
        base.OnCalculationPerformed(args);
    }
コード例 #2
0
    private void OnCalculationPerformed(CalculationEventArgs args)
    {
        // make a copy of the event
        EventHandler <CalculationEventArgs> handler = CalculationPerformedEvent;

        // check to see we have subscribers
        if (handler != null)
        {
            handler(this, args);
        }
    }
コード例 #3
0
 static void HandleEvent(object sender, CalculationEventArgs e)
 {
     Console.WriteLine("Good Class: {0} x {1} = {2}", e.X, e.Y, e.Result);
 }
コード例 #4
0
 public void HandleNotifyCalculation(object sender, CalculationEventArgs e)
 {
     // print out the details of the real calculation
     Console.WriteLine("NefariousClass: {0} x {1} = {2}",
                       e.X, e.Y, e.Result);
 }
コード例 #5
0
 private void CalculationCompleted(object sender, CalculationEventArgs args)
 {
     Assert.That(sender, Is.SameAs(_worker), "The sender should be the instance that invoked the event.");
     _receivedEventArgs.Add(args);
 }
コード例 #6
0
 private void CalculationCompleted(object sender, CalculationEventArgs args)
 {
     _receivedEventArgs.Add(args);
 }
コード例 #7
0
 public void OnCalc(object sender, CalculationEventArgs calculationEventArgs)
 {
     {
         Console.WriteLine("The result of your calculation is: " + calculationEventArgs.Calculation.GetResult() + "\n");
     }
 }