Professional IronPython


Creating the Simple C# Extension



Download 20,35 Mb.
Pdf ko'rish
bet348/453
Sana01.07.2022
Hajmi20,35 Mb.
#723045
1   ...   344   345   346   347   348   349   350   351   ...   453
Creating the Simple C# Extension
 

 
333
If you’re looking at the class in the IronPython console, you might want to give it a quick try before 
you close up the console and move on to the next part of the example. Try this code and you’ll see 
an output of 15 from the 
__add__()
method.
Value1 = Calcs.Calcs(10)
Value2 = Calcs.Calcs(5)
print Value1.__add__(Value2)
fIgURE 16-3: 
The dir() function shows the content of the Calcs class.
Adding the IronPython Project
At this point, you have a C# extension (or module) to use with IronPython. Of course, you’ll want 
to test it. The easiest way to do this is to add the IronPython project directly to the current solution. 
The following steps describe how to perform this task.
1.
Right-click the solution entry in Solution Explorer and choose Add
➤➤➪➤➤
Existing Project from 
the context menu. You see the Add Existing Project dialog box shown in Figure 16-4.
fIgURE 16-4: 
Locate IPY.EXE and add it to your solution.
548592c16.indd 333
2/24/10 12:49:23 PM
www.finebook.ir


334

CHAPTER 16
ExtEnding ironPython Using C#
2.
Locate 
IPY.EXE
on your hard drive and highlight it. Click Open. You see a new project entry 
added to the solution.
3.
Right-click the ipy entry in Solution Explorer and choose Set as Startup Project from the con-
text menu. This step ensures that choosing one of the startup options from the Debug menu 
starts the IronPython application.
4.
Right-click the ipy entry in Solution Explorer and choose Properties from the context menu. 
You’ll see the General tab of the ipy Properties window shown in Figure 16-5.

Download 20,35 Mb.

Do'stlaringiz bilan baham:
1   ...   344   345   346   347   348   349   350   351   ...   453




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