Professional IronPython


Using C# for Win32 Support



Download 20,35 Mb.
Pdf ko'rish
bet368/453
Sana01.07.2022
Hajmi20,35 Mb.
#723045
1   ...   364   365   366   367   368   369   370   371   ...   453
Using C# for Win32 Support
 

 
355
{
if ((ConsoleMode & (UInt32)ModeFlags.ENABLE_PROCESSED_OUTPUT) ==
(UInt32)ModeFlags.ENABLE_PROCESSED_OUTPUT)
Output.ProcessedOutput = true;
else
Output.ProcessedOutput = false;
if ((ConsoleMode & (UInt32)ModeFlags.ENABLE_WRAP_AT_EOL_OUTPUT)
== (UInt32)ModeFlags.ENABLE_WRAP_AT_EOL_OUTPUT)
Output.LineWrap = true;
else
Output.LineWrap = false;
}
// Return the results.
return Output;
}
This is one of the few situations in the chapter where you need to send a number of pieces of informa-
tion back to IronPython. The 
ConsoleData
structure contains an entry of each piece of information 
that the 
GetConsoleInfo()
provides. An IronPython application can set the output of the call to a 
variable and then use the variable content to determine precisely how the console is configured.
The 
GetConsoleInfo()
method is a little more complicated than the other calls in the extension. 
This method relies on the 
GetConsoleMode()
function to obtain console information. However, 
notice that the method calls the 
GetConsoleMode()
function twice, once with the input handle and 
again with the output handle. This method demonstrates how the use of the wrong handle could 
cause problems because the output from the 
GetConsoleMode()
function differs with the handle 
you provide as input.
The return value from the 
GetConsoleMode()
function is a series of flags. Notice how the code uses 
if
statements to determine whether each flag is set. When a flag is set, the feature is enabled and 
the code sets that value in the 
ConsoleData
data structure, 
Output
, to 
true
. The method ends by 
returning the fully completed 
ConsoleData
data structure to the caller.

Download 20,35 Mb.

Do'stlaringiz bilan baham:
1   ...   364   365   366   367   368   369   370   371   ...   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