Assume Method (Boolean)
Collapse the table of content
Expand the table of content

Contract.Assume Method (Boolean)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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)

[ConditionalAttribute("CONTRACTS_FULL")]
[ConditionalAttribute("DEBUG")]
public static void Assume(
	bool condition
)

Parameters

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

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

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2017 Microsoft