Determine Calling Object Type in C#

前端 未结 11 1015
灰色年华
灰色年华 2021-02-05 14:37

Regardless of whether or not this is a good idea, is it possible to implement an interface where the executing function is aware of the calling object\'s type?

c         


        
11条回答
  •  不要未来只要你来
    2021-02-05 14:54

    There is (almost) always a proper design that can accomplish what you need. If you take one step back to describe what you actually need to do, I am confident you'll get at least one good design that doesn't require you to have to resort to something like this.

提交回复
热议问题