[英]Check if an object's type is from a particular namespace
Is it possible to check if the object's type is a part of a particular namespace from C# code? 是否可以从C#代码检查对象的类型是否是特定命名空间的一部分? If yes, how? 如果有,怎么样?
I need to check if e.OriginElement as FrameworkElement
is one of the MS.Internal
controls. 我需要检查e.OriginElement as FrameworkElement
是MS.Internal
控件之一。
您可以检查Type.Namespace属性。
e.OriginElement.GetType().Namespace
e.OriginElement.GetType().Namespace
应该为您提供所需的信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.