static void Main(string[] args) { Factorial fact_delegate = new Factorial(FactorialFunc); IAsyncResult result = fact_delegate.BeginInvoke(10, new AsyncCallback(CallBack), "Это параметр"); Console.WriteLine("Можете что-то ввести:"); Console.ReadLine(); int fact = fact_delegate.EndInvoke(result); Console.WriteLine("Результат: {0}", fact); }
private void btnParallel_stream_Click(object sender, EventArgs e) { Factorial fact_delegat = new Factorial(FactorialFunk); fact_delegat.BeginInvoke(Int32.Parse(rtbFactorial_value.Text), null, null); }