namespace ConsoleApplication1
{
public delegate void Del(int data);
class Program
{
//Action<int>
//Func<int,int>
static void Main(string[] args)
{
fun();
}
static void fun()
{
Del callback = new Del((dataaaa) =>
{
Console.WriteLine(dataaaa);
});
callback += btn_click;
Thread t = new Thread(()=>
{
childThreadMethod(callback);
});
t.Start();
Console.ReadKey();
}
public static void btn_click(int data)
{
Console.WriteLine(data + 10);
}
static void childThreadMethod(Del d)
{
Thread.Sleep(5000);
int data = 10;
d(data);
}
}
}