Book III
Coding
Contents at a Glance
Chapter 1: Programming with Visual Studio 2010 . . . . . . . . . . .
. . . . .127
Using the Code Editor .................................................................................127
Exploring Visual Basic and C# ...................................................................138
Chapter 2: Understanding Data Types . . . . . . . . . . . . . . . . . . . .
. . . . . .145
The Rules of Data Types .............................................................................145
Making a Declaration ...................................................................................146
The .NET Frameworks Common Type System .......................................148
Creating Your Own Types ..........................................................................155
When Theres More than One ....................................................................158
Converting Types ........................................................................................166
Meet the Nullable Types .............................................................................168
Browsing Types ...........................................................................................169
Accessing Types in Your Source Code .....................................................176
Chapter 3: Get Some
Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .179
Bringing Programs to Life the Object-Oriented Way ..............................179
Whats with Objects? ..................................................................................181
Anatomy of a Class in .NET ........................................................................184
Using Class Designer ...................................................................................189
Chapter 4: Wiring Up Events in the User
Interface . . . . . . . . . . . . . . .205
Handling Events ...........................................................................................205
Getting a Life Cycle ......................................................................................212
Chapter 5: Getting Productive with Visual Studio
2010. . . . . . . . . . . .223
Sending Your Code to Boot Camp .............................................................223
Its Not Your Fathers IntelliSense Any More ...........................................231
Creating XML Documentation ....................................................................240
Factoring in the Refactoring .......................................................................245
Chapter 6: Exploring Web
Services . . . . . . . . . . . . . . . . . . . . . . . . . . . .251
Defining a Web Service ...............................................................................251
Saying Hello to Web Services .....................................................................252
Consuming a Web Service ..........................................................................265
Chapter 7: Handling Exceptions and
Debugging . . . . . . . . . . . . . . . . .275
Structured Exception Handling to the Rescue .........................................275
Understanding Debugging ..........................................................................284
Chapter 8: Testing Code with Visual Studio . . . . . . . . . . . . . . . .
. . . . .301
Defining Unit Testing ...................................................................................301
Unit Testing in Visual Studio ......................................................................303
Approaches to Unit Testing .......................................................................312
Automating Tests with Testing Frameworks ...........................................315