In c# you need an explicit boolean expression in an if-statement.
So you need to compare the result of
lGpiValue & (1 << sensor)
with a value.
For example:
int lGpiValue = 512;
int sensor = 3;
if ((lGpiValue & (1 << sensor)) != 0)
return 1;
if (Convert.ToBoolean(lGpiValue & (1 << sensor)))
return 1;