Chapter 3. .NET objects and IronPython
This chapter covers
- Reading the MSDN documentation
- .NET types: Classes, structures, enumerations, and collections
- Delegates and event handlers in IronPython
- Subclassing .NET classes
.NET is a large platform and has a great deal to offer programmers. The framework is extremely broad; the classes it provides cover almost every aspect of programming that you can imagine. The IronPython .NET integration makes it easy to use these classes directly from IronPython code; you’ll rarely do type conversion between Python types and .NET ones. Not only are the .NET objects straightforward to use and configure from within IronPython, but they’re also integrated into the Python infrastructure so that you can use Python idioms to work with them.
To understand how to use the .NET types available in the framework, you’ll need to be able to read the .NET documentation. In this chapter, you’ll create some basic applications using Windows Forms and translate the Microsoft documentation into IronPython along the way. Windows Forms is a mature library for building user interfaces for desktop applications. We could have picked almost any of the different libraries provided by .NET, but Windows Forms is a great library to work with, and it also makes for some very visual examples!