Throws an ArgumentException if a condition is not fulfilled.
Namespace:
PostSharp
Assembly:
PostSharp.Core (in PostSharp.Core.dll)
Syntax
| Visual Basic (Declaration) |
|---|
<ConditionalAttribute("ASSERT")> _
Public Sub AssertValidArgument ( _
condition As Boolean, _
parameterName As String, _
messageKey As String, _
ParamArray arguments As Object() _
) |
| C# |
|---|
[ConditionalAttribute("ASSERT")]
public void AssertValidArgument(
bool condition,
string parameterName,
string messageKey,
params Object[] arguments
) |
| Visual C++ |
|---|
[ConditionalAttribute(L"ASSERT")]
public:
void AssertValidArgument(
bool condition,
String^ parameterName,
String^ messageKey,
... array<Object^>^ arguments
) |
Parameters
- condition
- Type: System..::.Boolean
Condition. Should be true, otherwise an exception is thrown.
- parameterName
- Type: System..::.String
Name of the tested parameter.
- messageKey
- Type: System..::.String
Key of the resource string containing the message.
The message may contain arguments like {0}, {1}, ...
- arguments
- Type: array<
System..::.Object
>[]()[]
Arguments of the formatting string.
See Also