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



Download 21,46 Mb.
Pdf ko'rish
bet856/1830
Sana28.09.2021
Hajmi21,46 Mb.
#188411
1   ...   852   853   854   855   856   857   858   859   ...   1830
Bog'liq
[book] [en] Pro C# 2008 and the NET 3.5 Platform Fourth Edition



Source Code

The InterfaceExtension project can be found under the Chapter 13 subdirectory.



Understanding Partial Methods

Since the release of .NET 2.0, we have been able to build partial class definitions using the partial

keyword (see Chapter 5). Recall that this bit of syntax allows us to partition the full implementation

of a type across multiple code files (or other locations, such as in memory). As long as each aspect

of the partial type has the same fully qualified name, the end result is a single “normal” compiled

class type in the assembly being constructed.

C# 2008 widens the scope of the partial keyword in that it can now be applied on the method

level. In a nutshell, this allows you to prototype a method in one file, yet implement it in another

file. If you have a C++ background, this might remind you of the concept of a C++ header/imple-

mentation file; however, C# partial methods have a number of important restrictions:

• Partial methods can only be defined within a partial class.

• Partial methods must return void.

• Partial methods can be static or instance level.

• Partial methods can have arguments (including parameters modified by this, ref, or

params—but not with the out modifier).

• Partial methods are always implicitly private.

C H A P T E R   1 3  

C #   2 0 0 8   L A N G U A G E   F E AT U R E S



433

8849CH13.qxd  10/2/07  12:42 PM  Page 433




Even stranger is the fact that a partial method may or may not be emitted into the compiled

assembly!




Download 21,46 Mb.

Do'stlaringiz bilan baham:
1   ...   852   853   854   855   856   857   858   859   ...   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