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



Download 21,46 Mb.
Pdf ko'rish
bet867/1830
Sana28.09.2021
Hajmi21,46 Mb.
#188411
1   ...   863   864   865   866   867   868   869   870   ...   1830
Bog'liq
[book] [en] Pro C# 2008 and the NET 3.5 Platform Fourth Edition



Source Code

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



Understanding Anonymous Types

As an OO programmer, you know the benefits of defining classes to represent the state and func-

tionality of a given programming entity. To be sure, whenever you need to define a class that is

intended to be reused across projects and provides numerous bits of functionality through a set of

methods, events, properties, and custom constructors, creating a new C# class is common practice

and often mandatory.

However, there are other times in programming when you would like to define a class simply to

model a set of encapsulated (and somehow related) data points without any associated methods,

events, or other custom functionality. Furthermore, what if this type is only used internally to your

current application and it’s not intended to be reused? If you need such a “temporary” type, earlier

versions of C# would require you to nevertheless build a new class definition by hand:

internal class SomeClass

{

// Define a set of private member variables...



// Make a property for each member variable...

// Override ToString() to account for each member variable...

// Override GetHashCode() and Equals() to work with value based equality...

}

C H A P T E R   1 3  




Download 21,46 Mb.

Do'stlaringiz bilan baham:
1   ...   863   864   865   866   867   868   869   870   ...   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