Contract.Assume Method (Boolean)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Instructs code analysis tools to assume that the specified condition is true, even if it cannot be statically proven to always be true.

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

Syntax

'Declaration
<ConditionalAttribute("CONTRACTS_FULL")> _
<ConditionalAttribute("DEBUG")> _
Public Shared Sub Assume ( _
    condition As Boolean _
)
[ConditionalAttribute("CONTRACTS_FULL")]
[ConditionalAttribute("DEBUG")]
public static void Assume(
    bool condition
)

Parameters

  • condition
    Type: System.Boolean
    The conditional expression to assume true.

Remarks

At run time, using this method is equivalent to using the Assert(Boolean) method.

Version Information

Silverlight

Supported in: 5, 4

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.