Export (0) Print
Expand All

ContractHelper.TriggerFailure Method

Triggers the default failure behavior.

Namespace:  System.Diagnostics.Contracts.Internal
Assembly:  mscorlib (in mscorlib.dll)

[DebuggerNonUserCodeAttribute]
public static void TriggerFailure(
	ContractFailureKind kind,
	string displayMessage,
	string userMessage,
	string conditionText,
	Exception innerException
)

Parameters

kind
Type: System.Diagnostics.Contracts.ContractFailureKind
The type of failure.
displayMessage
Type: System.String
The message to display.
userMessage
Type: System.String
Additional user information.
conditionText
Type: System.String
The description of the condition that caused the failure.
innerException
Type: System.Exception
The inner exception that caused the current exception.

The default failure behavior is to raise an Assert, which causes the Assert dialog box to be displayed. You can change that behavior to throw an Exception instead of displaying the dialog box.

Silverlight

Supported in: 5, 4

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft