I'm looking at delegates for the first time and wondered what the differnce is between these two styles.
OfferList.NextPage += delegate(int page)
{
OnNextPage(page);
};
void OnNextPage(int page)
{
...
}
and
Toolbar.OfferBookmarkRemoved += new OfferBookmarkRemoved(OnOfferBookmarkRemoved);
void OnOfferBookmarkRemoved(int offerId)
{
...
}
Thanks in advance.
The first one is an Anonymous Method , and the second is a Name Method.
See also Delegates with Named vs. Anonymous Methods (C# Programming Guide)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.