简体   繁体   English

如果一个类是WinRT类型,如何确定使用C#反射

[英]How to determine using C# Reflection if a class is a WinRT type

Is there anyway at runtime to determine if a type is a WinRT class? 无论如何,在运行时是否可以确定类型是否为WinRT类? Ie if its WinRT then behave in one way, if its not then behave in another? 即,如果它的WinRT则以一种方式运行,如果不是,则其以另一种方式运行?

From http://blogs.msdn.com/b/ptorr/archive/2012/05/27/loading-winrt-types-via-reflection-in-windows-8.aspx http://blogs.msdn.com/b/ptorr/archive/2012/05/27/loading-winrt-types-via-reflection-in-windows-8.aspx

It looks like you can get the AssemblyQualifiedName and see if it contains ContentType=WindowsRuntime . 看起来您可以获取AssemblyQualifiedName并查看它是否包含ContentType=WindowsRuntime

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM