ContractFailedEventArgs Class

ContractFailedEventArgs Class

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Provides methods and data for the Contract::ContractFailed event.

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

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

No code example is currently available or this language may not be supported.

The ContractFailedEventArgs type exposes the following members.

  NameDescription
Public methodContractFailedEventArgsProvides data for the Contract::ContractFailed event.
Top

  NameDescription
Public propertyConditionGets the condition for the failure of the contract.
Public propertyFailureKindGets the type of contract that failed.
Public propertyHandledIndicates whether the Contract::ContractFailed event has been handled.
Public propertyMessageGets the message that describes the Contract::ContractFailed event.
Public propertyOriginalExceptionGets the original exception that caused the Contract::ContractFailed event.
Public propertyUnwindIndicates whether the code contract escalation policy should be applied.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSetHandledSecurity Critical. Sets the ContractFailedEventArgs::Handled property to true.
Public methodSetUnwindSecurity Critical. Sets the ContractFailedEventArgs::Unwind property to true.
Public methodToStringReturns 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.

Windows Phone OS

Supported in: 8.1, 8.0

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

Show:
© 2017 Microsoft