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!

Trace.Assert (Boolean, String)

Checks for a condition and displays a message if the condition is false.

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

Parameters

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

Remarks

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

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