C # MethodInfo getReturnType - PullRequest
       13

C # MethodInfo getReturnType

3 голосов
/ 18 июня 2009

Я создал экземпляр MethodInfo:

MethodInfo theMethod = typeof(Reciever).GetMethod("methodName", parameterTypes);

Теперь я хочу знать, является ли тип возвращаемого методу пустым. Как?

1 Ответ

11 голосов
/ 18 июня 2009

Легко:

theMethod.ReturnType == typeof(void)
...