Added CastEnum() method to convert argument to enumerated value of the correct type for calling macro/method