ContractHelper Class

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Note: This API is now obsolete.

Provides methods that the binary rewriter uses to handle contract failures.

Inheritance Hierarchy

System.Object
  System.Diagnostics.Contracts.Internal.ContractHelper

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

Syntax

'Declaration
<ObsoleteAttribute("Use the ContractHelper class in the System.Runtime.CompilerServices namespace instead.")> _
Public NotInheritable Class ContractHelper
[ObsoleteAttribute("Use the ContractHelper class in the System.Runtime.CompilerServices namespace instead.")]
public static class ContractHelper

The ContractHelper type exposes the following members.

Methods

  Name Description
Public methodStatic member RaiseContractFailedEvent Used by the binary rewriter to activate the default failure behavior.
Public methodStatic member TriggerFailure Triggers the default failure behavior.

Top

Version Information

Silverlight

Supported in: 4
Obsolete (compiler warning) in 5

Platforms

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

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.