ContractFailedEventArgs Class

.NET Framework 4.6 and 4.5

Provides methods and data for the Contract.ContractFailed event.

System.Object
  System.EventArgs
    System.Diagnostics.Contracts.ContractFailedEventArgs

Namespace:  System.Diagnostics.Contracts
Assemblies:   mscorlib (in mscorlib.dll)
  System.Diagnostics.Contracts (in System.Diagnostics.Contracts.dll)

[<Sealed>]
type ContractFailedEventArgs =  
    class 
        inherit EventArgs 
    end

The ContractFailedEventArgs type exposes the following members.

  NameDescription
Public methodSupported by Portable Class LibraryContractFailedEventArgsProvides data for the Contract.ContractFailed event.
Top

  NameDescription
Public propertySupported by Portable Class LibraryConditionGets the condition for the failure of the contract.
Public propertySupported by Portable Class LibraryFailureKindGets the type of contract that failed.
Public propertySupported by Portable Class LibraryHandledIndicates whether the Contract.ContractFailed event has been handled.
Public propertySupported by Portable Class LibraryMessageGets the message that describes the Contract.ContractFailed event.
Public propertySupported by Portable Class LibraryOriginalExceptionGets the original exception that caused the Contract.ContractFailed event.
Public propertySupported by Portable Class LibraryUnwindIndicates whether the code contract escalation policy should be applied.
Top

  NameDescription
Public methodSupported by Portable Class LibraryEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodSupported by Portable Class LibraryGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodSupported by Portable Class LibraryGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodSupported by Portable Class LibrarySetHandledSets the ContractFailedEventArgs.Handled property to true.
Public methodSupported by Portable Class LibrarySetUnwindSets the ContractFailedEventArgs.Unwind property to true.
Public methodSupported by Portable Class LibraryToStringReturns a string that represents the current object. (Inherited from Object.)
Top

A ContractFailedEventArgs object is passed to the Contract.ContractFailed event when a contract fails. The ContractFailed event enables a managed application environment such as an interactive interpreter, a Web browser host, a test harness, or a logging infrastructure to be notified of contract failures. The event requires full trust.

.NET Framework

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8

Portable Class Library

Supported in: Portable Class Library

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft