C# delegate not bound to an instance?

后端 未结 4 1946
盖世英雄少女心
盖世英雄少女心 2021-01-04 08:47

Is there a way to store a delegate without binding it to an object like how you can with a MethodInfo? Right now I am storing a MethodInfo so I can give it the object to cal

4条回答
  •  被撕碎了的回忆
    2021-01-04 09:25

    A delegate is essentially just a MethodInfo (actually, a MethodBase) and an object reference, with some internal pointers for performance. So if you have a MethodInfo, you essentially have an unbound delegate. What is your specific use case?

提交回复
热议问题