This print for content only-size & color not accurate 7" X 9-1/4" / casebound / malloy



Download 21,46 Mb.
Pdf ko'rish
bet754/1830
Sana28.09.2021
Hajmi21,46 Mb.
#188411
1   ...   750   751   752   753   754   755   756   757   ...   1830
Bog'liq
[book] [en] Pro C# 2008 and the NET 3.5 Platform Fourth Edition



Source Code

The LambdaExpressionsMultipleParams project can be found under the Chapter 11

subdirectory.

Summary

In this chapter, you have examined a number of ways in which multiple objects can partake in a

bidirectional conversation. First, you examined the C# delegate keyword, which is used to indi-

rectly construct a class derived from System.MulticastDelegate. As you have seen, a delegate is

simply an object that maintains a list of methods to call when told to do so. These invocations may

be made synchronously (using the Invoke() method) or asynchronously (via the BeginInvoke() and

EndInvoke() methods). Again, the asynchronous nature of .NET delegate types will be examined in

Chapter 18.

You then examined the C# event keyword which, when used in conjunction with a delegate

type, can simplify the process of sending your event notifications to awaiting callers. As shown via

the resulting CIL, the .NET event model maps to hidden calls on the System.Delegate/System.

MulticastDelegate types. In this light, the C# event keyword is purely optional in that it simply

saves you some typing time.

This chapter also examined a C# language feature termed 



anonymous methods. Using this syn-

tactic construct, you are able to directly associate a block of code statements to a given event. As

you have seen, anonymous methods are free to ignore the parameters sent by the event and have

access to the “outer variables” of the defining method. You also examined a simplified way to regis-

ter events using method group conversion.

Finally, we wrapped things up by examining the C# 2008 



lambda operator, =>. As shown, this

syntax is a great shorthand notation for authoring anonymous methods, where a stack of argu-

ments can be passed into a group of statements for processing.

C H A P T E R   1 1  




Download 21,46 Mb.

Do'stlaringiz bilan baham:
1   ...   750   751   752   753   754   755   756   757   ...   1830




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish