public CountPiXThread(FunctionPiX functionPiX, Dispatcher dispatcher, ObjectParameterDelegate objdelegate, PrimesBigInteger to) { this.m_FunctionPiX = functionPiX; this.m_Dispatcher = dispatcher; m_objdelegate = objdelegate; m_To = to; }
public void DoCountPrimes(object o) { if (o != null && o.GetType() == typeof(PrimesBigInteger)) { FunctionPiX func = new FunctionPiX(); func.ShowIntermediateResult = true; m_refreshcount = 0; func.Executed += new ObjectParameterDelegate(func_Executed); double erg = func.Execute((o as PrimesBigInteger).DoubleValue); ControlHandler.SetPropertyValue(lblInfoCountPrimes, "Text", StringFormat.FormatDoubleToIntString(erg)); } }
protected override void DoExecute() { FireOnStart(); FunctionPiX pix = new FunctionPiX(); PrimesBigInteger from = m_From; PrimesBigInteger _counterTmp = PrimesBigInteger.Two; while (_counterTmp.CompareTo(from) <= 0) { double result = pix.Execute(_counterTmp.DoubleValue); FireOnMessage(this, from, StringFormat.FormatDoubleToIntString(result)); _counterTmp = _counterTmp.Add(PrimesBigInteger.One); } while (from.CompareTo(m_To) <= 0) { double result = pix.Execute(from.DoubleValue); FireOnMessage(this, from, StringFormat.FormatDoubleToIntString(result)); from = from.Add(PrimesBigInteger.One); } FireOnStop(); }