As i can perform asynchronous operations using delegates,i suspect there is a thin chance to use System.Threading in my application.Is there any essential situation where i can not avoid System.Threading ?
( Just I am in learning Phase).
Example :
class Program
{
public delegate int Total (int a,int b);
static void Main()
{
Total tl = new Total(SumUp);
IAsyncResult isany=tl.BeginInvoke(20,20, null, null);
while (!isany.IsCompleted)
{
Console.WriteLine("Busy with other work");
}
int ans = tl.EndInvoke(isany);
Console.WriteLine("Result ={0}", ans);
}
static int SumUp(int a,int b)
{
a = a * a;
b = b * b;
return a + b;
}
}