ContractFailedEventArgs Class

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)

public sealed class ContractFailedEventArgs : EventArgs

The ContractFailedEventArgs type exposes the following members.

  NameDescription
Public methodSupported by Portable Class LibrarySupported in .NET for Windows Store appsContractFailedEventArgsProvides data for the Contract.ContractFailed event.
Top

  NameDescription
Public propertySupported by Portable Class LibrarySupported in .NET for Windows Store appsConditionGets the condition for the failure of the contract.
Public propertySupported by Portable Class LibrarySupported in .NET for Windows Store appsFailureKindGets the type of contract that failed.
Public propertySupported by Portable Class LibrarySupported in .NET for Windows Store appsHandledIndicates whether the Contract.ContractFailed event has been handled.
Public propertySupported by Portable Class LibrarySupported in .NET for Windows Store appsMessageGets the message that describes the Contract.ContractFailed event.
Public propertySupported by Portable Class LibrarySupported in .NET for Windows Store appsOriginalExceptionGets the original exception that caused the Contract.ContractFailed event.
Public propertySupported by Portable Class LibrarySupported in .NET for Windows Store appsUnwindIndicates whether the code contract escalation policy should be applied.
Top

  NameDescription
Public methodSupported by Portable Class LibrarySupported in .NET for Windows Store appsEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodSupported by Portable Class LibrarySupported in .NET for Windows Store appsGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodSupported by Portable Class LibrarySupported in .NET for Windows Store appsGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodSupported by Portable Class LibrarySupported in .NET for Windows Store appsSetHandledSets the ContractFailedEventArgs.Handled property to true.
Public methodSupported by Portable Class LibrarySupported in .NET for Windows Store appsSetUnwindSets the ContractFailedEventArgs.Unwind property to true.
Public methodSupported by Portable Class LibrarySupported in .NET for Windows Store appsToStringReturns 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

Portable Class Library

Supported in: Portable Class Library

.NET for Windows Store apps

Supported in: Windows 8

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

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:
© 2014 Microsoft