专注于互联网--专注于架构

最新标签
网站地图
文章索引
Rss订阅

首页 »DotNet » delegate:c# delegate 的使用方法 »正文

delegate:c# delegate 的使用方法

来源: 发布时间:星期三, 2008年9月10日 浏览:339次 评论:0

一个C#中delegate的使用方法实例,给新手学习一下吧。

delegatevoidFoundOperation();
classBookStore//作者A
{
FoundOperationf=newFoundOperation(otherclass.fop)//注意
publicstaticvoidMain()
{
find();
}

publicvoidfind()
{
.......
f();//通过代理调用otherclass里方法里具体实现什么本身是不知道.只知道有这个一样签名.
}

}
}
classotherclass//作者B
{
publicstaticvoidfop()
{
.....
}
} www.

0

相关文章

读者评论

发表评论

  • 昵称:
  • 内容: