Ejemplo n.º 1
0
        public override async void StartCalc()
        {
            base.StartCalc();
            _cancellationTokenSource = new CancellationTokenSource();

            PiCalcAsync calcAsync = new PiCalcAsync(CreateProgressObject());
            await calcAsync.CalculateAsync(_calcData, _cancellationTokenSource.Token);
        }
Ejemplo n.º 2
0
        public override async void StartCalc()
        {
            base.StartCalc();
            _cancellationTokenSource = new CancellationTokenSource();

            PiCalcAsync   calcAsync = new PiCalcAsync(CreateProgressObject());
            Task <double> calcTask  = calcAsync.CalculateAsync(IterationsRequested, _cancellationTokenSource.Token);

            _piCalculated = await calcTask;

            base.StopCalc();
        }