When is obj.GetType().IsInstanceOfType(typeof(MyClass)) true?

后端 未结 5 942
终归单人心
终归单人心 2021-01-06 06:52

I\'m looking at this piece of code written by someone else, and I\'m wondering when it would evaluate to true. Basically, it is saying someType is an instance of someOtherT

5条回答
  •  被撕碎了的回忆
    2021-01-06 07:38

    IsInstanceOfType Determines whether the specified object is an instance of the current Type.

    Sample : IsInstanceOfType(o)

    true if the current Type is in the inheritance hierarchy of the object represented by o, or if the current Type is an interface supported by o. false if none of these conditions is not met, or if o is null, or if the current Type is an open generic type

提交回复
热议问题