STrace.Assert 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
检查条件。 如果条件为 false,此方法将发送消息并显示一个说明调用堆栈的消息框。
重载
Assert(Boolean) |
检查条件。 如果条件为 false,将显示一个说明调用堆栈的消息框。 |
Assert(Boolean, String) |
检查条件。 如果条件为 false,此方法将发送指定的消息并显示一个说明调用堆栈的消息框。 |
注解
标识为仅供参考。 不支持。 不保证以后的兼容性。
此方法仅适用于调试版本。
Assert(Boolean)
检查条件。 如果条件为 false,将显示一个说明调用堆栈的消息框。
public:
static void Assert(bool condition);
[System.Diagnostics.Conditional("DEBUG")]
public static void Assert (bool condition);
[<System.Diagnostics.Conditional("DEBUG")>]
static member Assert : bool -> unit
Public Shared Sub Assert (condition As Boolean)
参数
- condition
- Boolean
要计算的条件表达式。 如果条件为 true,则不发送失败消息,并且不显示消息框。
- 属性
注解
标识为仅供参考。 不支持。 不保证以后的兼容性。
此方法仅适用于调试版本。
适用于
Assert(Boolean, String)
检查条件。 如果条件为 false,此方法将发送指定的消息并显示一个说明调用堆栈的消息框。
public:
static void Assert(bool condition, System::String ^ message);
[System.Diagnostics.Conditional("DEBUG")]
public static void Assert (bool condition, string message);
[<System.Diagnostics.Conditional("DEBUG")>]
static member Assert : bool * string -> unit
Public Shared Sub Assert (condition As Boolean, message As String)
参数
- condition
- Boolean
要计算的条件表达式。 如果条件为 true,则不发送指定消息,并且不显示消息框。
- message
- String
要发送的消息。
- 属性
注解
标识为仅供参考。 不支持。 不保证以后的兼容性。
此方法仅适用于调试版本。