C# Reflection: Is it possible to find an instance of an object at runtime?

前端 未结 7 1107
说谎
说谎 2020-12-07 01:53

I\'m wondering if it\'s possible to use reflection to locate an object at runtime? This is more of an experiment than a practical requirement.

I\'ve used the .GetTyp

7条回答
  •  青春惊慌失措
    2020-12-07 02:41

    No, basically.

    You could have some sort of horrible global map from type to "the instance of the type I'm interested in" but otherwise, no.

    Basically, the WinForms app should pass a reference to the form into the DLL somehow.

提交回复
热议问题