private bool? Or(FilterContext context, IFilterTarget target, ContentFilterElement element)
{
FilterOperand[] operands = GetOperands(element, 2);
bool? lhs = GetValue(context, operands[0], target) as bool?;
// no need for further processing if first operand is true.
if (lhs != null && lhs.Value)
{
return true;
}
bool? rhs = GetValue(context, operands[1], target) as bool?;
if (lhs == null)
{
if (rhs == null || rhs == false)
{
return null;
}
else
{
return true;
}
}
if (rhs == null)
{
if (lhs == null || lhs == false)
{
return null;
}
else
{
return true;
}
}
return lhs.Value || rhs.Value;
}