c# OR operator, how to find out which option triggered

You can do it using else if condition.

E.g.:

    if(option1 && !option2)
    {
        //Option 1
    }else if(!option1 && option2)
    {
        //option 2
    }else if(option1 && option2)
    {
        //both
    }
    else
    {
        //no option
    }

Browse More Popular Posts

Leave a Comment