Exemple #1
0
    private void BackgroundWorker1_DoWork(
        object sender,
        System.ComponentModel.DoWorkEventArgs e)
    {
        AreaClass2 AreaObject2 = (AreaClass2)e.Argument;

        // Return the value through the Result property.
        e.Result = AreaObject2.CalcArea();
    }
Exemple #2
0
        private void BackgroundWorker1_DoWork(
            object sender,
            System.ComponentModel.DoWorkEventArgs e)
        {
            // Load the object that was passed as an argument
            AreaClass2 AreaObject2Internal = (AreaClass2)e.Argument;

            // Run the calculation and store the result through the result property
            e.Result = AreaObject2Internal.CalcArea();
        }