Just to explain Bryian'c solution a little: '||' is the conditional OR operator, and it takes two bool values and returns a bool result:
bool result = a || b;
Where the result is true if either or both operands is true and false otherwise:
result a b
false false false
true false true
true true false
true true true
In C#, it is also defined that the condition
a
will be evaluated first, and if true, the condition b will not be evaluated at all (this is important later on)
So when you write an
if
condition that includes the OR operator, the left and right sides must be complete expressions which result in a bool value.
There is also an AND operator '&&' which returns true if both operands are true and false otherwise:
result a b
false false false
false false true
false true false
true true true
This also only evaluates
b
if
a
is true.