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



Download 21,46 Mb.
Pdf ko'rish
bet727/1830
Sana28.09.2021
Hajmi21,46 Mb.
#188411
1   ...   723   724   725   726   727   728   729   730   ...   1830
Bog'liq
[book] [en] Pro C# 2008 and the NET 3.5 Platform Fourth Edition

// Remove CarExploded method

// from invocation list.

c1.Exploded -= d;

Console.WriteLine("\n***** Speeding up *****");

for (int i = 0; i < 6; i++)

c1.Accelerate(20);

Console.ReadLine();

}

public static void CarAboutToBlow(string msg)



{ Console.WriteLine(msg); }

public static void CarIsAlmostDoomed(string msg)

{ Console.WriteLine("Critical Message from Car: {0}", msg); }

public static void CarExploded(string msg)

{ Console.WriteLine(msg); }

}

Simplifying Event Registration Using Visual Studio 2008

Visual Studio 2008 offers assistance with the process of registering event handlers. When you apply

the += syntax during the act of event registration, you will find an IntelliSense window is displayed

inviting you to hit the Tab key to autofill the associated delegate instance (see Figure 11-6).

C H A P T E R   1 1  



D E L E G AT E S, E V E N T S, A N D   L A M B D A S



366

8849CH11.qxd  10/1/07  10:43 AM  Page 366




Figure 11-6.

Delegate selection IntelliSense

Once you do hit the Tab key, you are then invited to enter the name of the event handler to be

generated (or simply accept the default name) as shown in Figure 11-7.

Figure 11-7.

Delegate target format IntelliSense

Once you hit the Tab key again, you will be provided with stub code in the correct format of the

delegate target (note that this method has been declared static due to the fact that the event was

registered within the static Main() method):

static void c1_AboutToBlow(string msg)

{

// Add your code!



}

This IntelliSense feature is available to all .NET events in the base class libraries. This IDE fea-

ture is a massive time-saver, given that this removes you from the act of needing to search the .NET

help system to figure out the correct delegate to use with a particular event as well as the format of

the delegate target.


Download 21,46 Mb.

Do'stlaringiz bilan baham:
1   ...   723   724   725   726   727   728   729   730   ...   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