<Type Name="ContractHelper" FullName="System.Diagnostics.Contracts.Internal.ContractHelper">
  <TypeSignature Language="C#" Value="public static class ContractHelper" />
  <AssemblyInfo>
    <AssemblyName>mscorlib</AssemblyName>
    <AssemblyVersion>4.0.0.0</AssemblyVersion>
  </AssemblyInfo>
  <Base>
    <BaseTypeName>System.Object</BaseTypeName>
  </Base>
  <Interfaces />
  <Docs>
    <summary>Methods required by the contract rewriter to handle contract failures.</summary>
    <remarks>These methods are called by code that has been rewritten by the Ccrewrite tool.</remarks>
  </Docs>
  <Members>
    <Member MemberName="RaiseContractFailedEvent">
      <MemberSignature Language="C#" Value="public static string RaiseContractFailedEvent (System.Diagnostics.Contracts.ContractFailureKind failureKind, string userMessage, string conditionText, Exception innerException);" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>4.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>System.Diagnostics.DebuggerNonUserCode</AttributeName>
        </Attribute>
        <Attribute>
          <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName>
        </Attribute>
      </Attributes>
      <ReturnValue>
        <ReturnType>System.String</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="failureKind" Type="System.Diagnostics.Contracts.ContractFailureKind" />
        <Parameter Name="userMessage" Type="System.String" />
        <Parameter Name="conditionText" Type="System.String" />
        <Parameter Name="innerException" Type="System.Exception" />
      </Parameters>
      <Docs>
        <param name="failureKind">The kind of contract failure.</param>
        <param name="userMessage">The user message describing this contract failure.</param>
        <param name="conditionText">The condition that caused this contract failure.</param>
        <param name="innerException">The exception that caused this contract filure, if any.</param>
        <summary>Implements the default behaviour on code contract failure.</summary>
        <returns>The code contract failure message, if the failure has not been handled already. Null if the failure has been handled successfully.</returns>
        <remarks>The default behaviour is to call each event handler in turn, with exceptions thrown in the handlers treated as calls to <see cref="m:System.Diagnostics.Contracts.ContractFailedEventArgs.SetUnwind()" />. This is defined fully in section 7.3 of UserDoc.pdf from Microsoft.</remarks>
      </Docs>
    </Member>
    <Member MemberName="TriggerFailure">
      <MemberSignature Language="C#" Value="public static void TriggerFailure (System.Diagnostics.Contracts.ContractFailureKind kind, string displayMessage, string userMessage, string conditionText, Exception innerException);" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>4.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>System.Diagnostics.DebuggerNonUserCode</AttributeName>
        </Attribute>
        <Attribute>
          <AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName>
        </Attribute>
      </Attributes>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="kind" Type="System.Diagnostics.Contracts.ContractFailureKind" />
        <Parameter Name="displayMessage" Type="System.String" />
        <Parameter Name="userMessage" Type="System.String" />
        <Parameter Name="conditionText" Type="System.String" />
        <Parameter Name="innerException" Type="System.Exception" />
      </Parameters>
      <Docs>
        <param name="kind">The kind of contract failure.</param>
        <param name="displayMessage">The message to display describing this contract failure.</param>
        <param name="userMessage">The user message describing this contract failure.</param>
        <param name="conditionText">The condition that caused this contract failure.</param>
        <param name="innerException">The exception that caused this contract filure, if any.</param>
        <summary>Implements the default code contract failure behaviour.</summary>
        <remarks>The default code contract failure behaviour is to trigger an assert if in user interactive mode, otherwise <see cref="m:System.Environment.FailFast(string message)" /> is called to immediately terminate the process.</remarks>
      </Docs>
    </Member>
  </Members>
</Type>
