When you use an if statement, the result should be a boolean (true, false). Your method returns a void. You are basically saying if (void) which does not evaluate to true or false.
Perhaps you should return a true or false from your method and then it will work. Or you can return something else from your method and then do a check on the value returned. For example:
private string Blockace(object sender, EventArgs e)
{
// do some work
return "yes";
}
Then you can check against the returned value. But you will need to send the 2 arguments as well: sender and e
if (Blockace(sender, e) == "yes")
{
// do whatever you need
}
I can see from blockace method signature it is an event handler. You need to reuse the code inside it from UI control (click or something) but you also need to use it from your code. Therefore create a method and put the common code there. Then you can call the method containing the common code from the event handler and also from elsewhere.