Here are the examples of the csharp api System.Predicate.Invoke(bool) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
3 Examples
19
Source : Guard.Boolean.cs
with MIT License
from maiconheck
with MIT License
from maiconheck
public Guard True(Predicate<bool> predicate, string message = "")
{
Guard.Against.Null(predicate, nameof(predicate));
if (predicate.Invoke(true))
{
if (string.IsNullOrWhiteSpace(message))
{
throw new ArgumentException(Texts.PredicateCannotBeTrue);
}
throw new ArgumentException(message);
}
return this;
}
19
Source : Guard.Boolean.cs
with MIT License
from maiconheck
with MIT License
from maiconheck
public Guard False(Predicate<bool> predicate, string message = "")
{
Guard.Against.Null(predicate, nameof(predicate));
if (!predicate.Invoke(false))
{
if (string.IsNullOrWhiteSpace(message))
{
throw new ArgumentException(Texts.PredicateCannotBeFalse);
}
throw new ArgumentException(message);
}
return this;
}
19
Source : Dialog_OutputMinMax.cs
with MIT License
from zymex22
with MIT License
from zymex22
public static void Tick()
{
if (gracePeriod >= 0) gracePeriod--;
if (gracePeriod == 0 && predicate(minIsMax))
{
parrent?.OverrideBuffer(minIsMax);
}
}