O'Reilly logo

MCAD/MCSD.NET Training Guide (Exam 70-316): Developing and Implementing Windows®-Based Applications with Microsoft® Visual C#™ .NET and Microsoft® Visual Studio® .NET by MCSD Amit Kalani - MCAD

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Apply Your Knowledge

Exercises

12.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 316C12Exercises ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required