NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Debug.Assert (Boolean)

Checks for a condition and outputs the callstack if the condition is false.

[Visual Basic]
Overloads Public Shared Sub Assert( _
   ByVal condition As Boolean _
)
[C#]
public static void Assert(
   bool condition
);
[C++]
public: static void Assert(
   bool condition
);
[JScript]
public static function Assert(
   condition : Boolean
);

Parameters

condition
A condition which if false causes a message to be displayed.

Remarks

Assert outputs the callstack with file and line number, if it is available, for each line in the callstack.

Typically Assert is used to identify logic errors during program development. Assert will evaluate the condition. If the result is false, it sends diagnostic messages to the Listeners.

The default behavior is to display a message box when the application is running in a user interface mode, and to output the message to the default trace output. You can customize this behavior by adding a TraceListener to or removing one from the Listeners collection.

See Also

Debug Class | Debug Members | System.Diagnostics Namespace | Debug.Assert Overload List | Debug | Trace | BooleanSwitch | TraceSwitch | TraceListener | DefaultTraceListener | ConditionalAttribute | ConditionalAttribute | ConditionalAttribute