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


Building an Extendable Windows Forms Application



Download 21,46 Mb.
Pdf ko'rish
bet1077/1830
Sana28.09.2021
Hajmi21,46 Mb.
#188411
1   ...   1073   1074   1075   1076   1077   1078   1079   1080   ...   1830
Bog'liq
[book] [en] Pro C# 2008 and the NET 3.5 Platform Fourth Edition

Building an Extendable Windows Forms Application

The final step is to create a new Windows Forms application (MyExtendableApp) that allows the

user to select a snap-in using a standard Windows Open dialog box. Next, set a reference to the

CommonSnappableTypes.dll assembly, but not the CSharpSnapIn.dll or VbNetSnapIn.dll code

libraries. Remember that the whole goal of this application is to make use of late binding and

reflection to determine the “snapability” of independent binaries created by third-party vendors.

Again, I won’t bother to examine all the details of Windows Forms development at this point

in the text. However, assuming you have placed a MenuStrip component onto the forms designer,

define a topmost menu item named File that provides a single submenu named Snap In Module. As

well, the main window will contain a ListBox type (which I renamed as lstLoadedSnapIns) that will

be used to display the names of each snap-in loaded by the user. Figure 16-11 shows the final GUI.

Figure 16-11.

GUI for MyExtendableApp

The code that handles the Click event for the File ➤ Snap In Module menu item (which may

be created simply by double-clicking the menu item from the design-time editor) displays a File

Open dialog box and extracts the path to the selected file. Assuming the user did not select the

CommonSnappableTypes.dll assembly (as this is purely infrastructure), the path is then sent into a

helper function named LoadExternalModule() for processing. This method will return false when

it is unable to find a class implementing IAppFunctionality:

private void snapInModuleToolStripMenuItem_Click(object sender,

EventArgs e)

{


Download 21,46 Mb.

Do'stlaringiz bilan baham:
1   ...   1073   1074   1075   1076   1077   1078   1079   1080   ...   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