Apply Your Knowledge
Exercises
9.1. Creating a Custom Trace Switch
The TraceSwitch and BooleanSwitch classes are two classes that provide trace switch functionality. If you need different trace levels or different implementations of the Switch class, you can inherit from the Switch class to implement your own custom trace switches.
In this exercise, you will learn how to create a custom switch. You will create a FactorialSwitch class that can be set with four values (Negative (-1), Off (0), Overflow (1), and Both (2)) for the Factorial Calculator form. The class will have two properties: Negative and Overflow.
Estimated time: 25 minutes.
1. | Launch Visual Studio .NET. Select File, New, Blank Solution, and name the new project 320C09Exercises ... |
Get MCAD/MCSD Training Guide (70-320): Developing XML Web Services and Server Components with Visual C#™ .NET and the Microsoft .NET Framework now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.