January 2003
Intermediate to advanced
896 pages
19h 58m
English
The .NET Compact Framework also supports a Trace class, which is in effect for both debug and release builds. In the .NET Compact Framework, this class supports only the Assert method and does not support full tracing the way the full .NET Framework counterpart does.
using System.Diagnostics; ⋮ Trace.Assert(bean.IsMagic, "This is not a magic bean");
In this example, if the assertion is true, nothing is displayed. If bean.IsMagic is false, the dialog box shown in Figure 5-13 appears.

Figure 5-13. Managed Assert Failure dialog box.
The Abort button terminates the application. The Retry button will try to connect ...
Read now
Unlock full access