?????????????????????????????????????????????????б??????????????????????????????????????????????е?????????????
????1. ????????????????
//define callback delegate
public delegate void CallBack(string result);
//process method
public void Processer(string args?? CallBack resultHandle)
{
//get result...
string result = "args is" + args;
//handle the result
resultHandle(result);
}
//handel the result
public void DisplayResult(string result)
{
Console.WriteLine(result);
}
//callback delegate example
public void Main()
{
Processer("??????????"?? new CallBack(DisplayResult));
}
?????????а????????????裺
????1. ?????????CallBack???????????????????????????
????2. ????????????????Processer???????????????????????????????????????????????????????????????????????????????
????3. ??????????巽??DisplayResult???÷???????????????????CallBack????????
????4. ??????????????Main???÷?????????????Processer????????“??????????”??????????????????ж??? new CallBack??DisplayResult????????DisplayResult???????ж????У????????Processer????????resultHandle????Precesser??????????????resultHandle(result);?????ж??????DisplayResult??????????????????????
??????????????????а???????????????·???PrintResult??????????????????????????????????????????????????????á???????????