开发者

Get class that method was defined in?

开发者 https://www.devze.com 2023-02-02 15:51 出处:网络
Given a MethodInfo obje开发者_运维问答ct, how can I get the Type object for the class that it was defined in?You\'re looking for the DeclaringType property:

Given a MethodInfo obje开发者_运维问答ct, how can I get the Type object for the class that it was defined in?


You're looking for the DeclaringType property:

Gets the class that declares this member.


Oh... I think it's DeclaringType.


You can get the Type the method belongs to with the DeclaringType property

0

精彩评论

暂无评论...
验证码 换一张
取 消