Check if an object is a delegate

后端 未结 4 1029
一个人的身影
一个人的身影 2021-01-11 10:10

In .NET, Is there a way to check whether an object is of a delegate type?

I need this because I\'m logging the parameters of method calls, and I want to print

4条回答
  •  一向
    一向 (楼主)
    2021-01-11 10:30

    You can just check whether obj is Delegate.
    All delegate types inherit the base Delegate class.

提交回复
热议问题