packages/System.Diagnostics.Contracts.4.3.0/ref/netcore50/System.Diagnostics.Contracts.xml

(开头部分) 25KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?xml version="1.0" encoding="utf-8"?>
<doc>
  <assembly>
    <name>System.Diagnostics.Contracts</name>
  </assembly>
  <members>
    <member name="T:System.Diagnostics.Contracts.Contract">
      <summary>Contains static methods for representing program contracts such as preconditions, postconditions, and object invariants.</summary>
    </member>
    <member name="M:System.Diagnostics.Contracts.Contract.Assert(System.Boolean)">
      <summary>Checks for a condition; if the condition is false, follows the escalation policy set for the analyzer.</summary>
      <param name="condition">The conditional expression to test.</param>
    </member>
    <member name="M:System.Diagnostics.Contracts.Contract.Assert(System.Boolean,System.String)">
      <summary>Checks for a condition; if the condition is false, follows the escalation policy set by the analyzer and displays the specified message.</summary>
      <param name="condition">The conditional expression to test.</param>
      <param name="userMessage">A message to display if the condition is not met.</param>
    </member>
    <member name="M:System.Diagnostics.Contracts.Contract.Assume(System.Boolean)">
      <summary>Instructs code analysis tools to assume that the specified condition is true, even if it cannot be statically proven to always be true.</summary>
      <param name="condition">The conditional expression to assume true.</param>
    </member>
    <member name="M:System.Diagnostics.Contracts.Contract.Assume(System.Boolean,System.String)">
      <summary>Instructs code analysis tools to assume that a condition is true, even if it cannot be statically proven to always be true, and displays a message if the assumption fails.</summary>
      <param name="condition">The conditional expression to assume true.</param>
      <param name="userMessage">The message to post if the assumption fails.</param>
    </member>
    <member name="E:System.Diagnostics.Contracts.Contract.ContractFailed">
      <summary>Occurs when a contract fails.</summary>
    </member>
    <member name="M:System.Diagnostics.Contracts.Contract.EndContractBlock">
      <summary>Marks the end of the contract section when a method's contracts contain only preconditions in the if-then-throw form.</summary>
    </member>
    <member name="M:System.Diagnostics.Contracts.Contract.Ensures(System.Boolean)">
      <summary>Specifies a postcondition contract for the enclosing method or property.</summary>
      <param name="condition">The conditional expression to test. The expression may include <see cref="M:System.Diagnostics.Contracts.Contract.OldValue``1(``0)" />, <see cref="M:System.Diagnostics.Contracts.Contract.ValueAtReturn``1(``0@)" />, and <see cref="M:System.Diagnostics.Contracts.Contract.Result``1" /> values. </param>
    </member>
    <member name="M:System.Diagnostics.Contracts.Contract.Ensures(System.Boolean,System.String)">
      <summary>Specifies a postcondition contract for a provided exit condition and a message to display if the condition is false.</summary>
      <param name="condition">The conditional expression to test. The expression may include <see cref="M:System.Diagnostics.Contracts.Contract.OldValue``1(``0)" /> and <see cref="M:System.Diagnostics.Contracts.Contract.Result``1" /> values. </param>
      <param name="userMessage">The message to display if the expression is not true.</param>
    </member>
    <member name="M:System.Diagnostics.Contracts.Contract.EnsuresOnThrow``1(System.Boolean)">
      <summary>Specifies a postcondition contract for the enclosing method or property, based on the provided exception and condition.</summary>
      <param name="condition">The conditional expression to test.</param>
      <typeparam name="TException">The type of exception that invokes the postcondition check.</typeparam>
    </member>
    <member name="M:System.Diagnostics.Contracts.Contract.EnsuresOnThrow``1(System.Boolean,System.String)">
      <summary>Specifies a postcondition contract and a message to display if the condition is false for the enclosing method or property, based on the provided exception and condition.</summary>
      <param name="condition">The conditional expression to test.</param>
      <param name="userMessage">The message to display if the expression is false.</param>
      <typeparam name="TException">The type of exception that invokes the postcondition check.</typeparam>
    </member>
    <member name="M:System.Diagnostics.Contracts.Contract.Exists``1(System.Collections.Generic.IEnumerable{``0},System.Predicate{``0})">
      <summary>Determines whether an element within a collection of elements exists within a function.</summary>
      <returns>true if and only if <paramref name="predicate" /> returns true for any element of type <paramref name="T" /> in <paramref name="collection" />.</returns>
      <param name="collection">The collection from which elements of type <paramref name="T" /> will be drawn to pass to <paramref name="predicate" />.</param>
      <param name="predicate">The function to evaluate for an element in <paramref name="collection" />.</param>
      <typeparam name="T">The type that is contained in <paramref name="collection" />.</typeparam>
      <exception cref="T:System.ArgumentNullException">
后面还有 274 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。