ContractFailedEventArgs 类

定义

ContractFailed 事件提供方法和数据。Provides methods and data for the ContractFailed event.

public ref class ContractFailedEventArgs sealed : EventArgs
public sealed class ContractFailedEventArgs : EventArgs
type ContractFailedEventArgs = class
    inherit EventArgs
Public NotInheritable Class ContractFailedEventArgs
Inherits EventArgs
继承
ContractFailedEventArgs

注解

当协定失败时, Contract.ContractFailed 对象将传递给事件。ContractFailedEventArgsA ContractFailedEventArgs object is passed to the Contract.ContractFailed event when a contract fails. ContractFailed事件使托管的应用程序环境 (如交互式解释器、Web 浏览器主机、测试工具或日志记录基础结构) 能够通知合同失败。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.

构造函数

ContractFailedEventArgs(ContractFailureKind, String, String, Exception)

ContractFailed 事件提供数据。Provides data for the ContractFailed event.

属性

Condition

获取协定失败的条件。Gets the condition for the failure of the contract.

FailureKind

获取失败的协定的类型。Gets the type of contract that failed.

Handled

指示是否已处理 ContractFailed 事件。Indicates whether the ContractFailed event has been handled.

Message

获取描述 ContractFailed 事件的消息。Gets the message that describes the ContractFailed event.

OriginalException

获取导致 ContractFailed 事件的原始异常。Gets the original exception that caused the ContractFailed event.

Unwind

指示是否应该应用代码协定升级策略。Indicates whether the code contract escalation policy should be applied.

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
SetHandled()

Handled 属性设置为 trueSets the Handled property to true.

SetUnwind()

Unwind 属性设置为 trueSets the Unwind property to true.

ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

适用于