【问题标题】:Determine the basetype of a type in UWP确定 UWP 中类型的基本类型
【发布时间】:2016-08-08 15:01:54
【问题描述】:

我正在开发一个 win 10 应用程序。我想知道一个类型的 BaseType。如何在 uwp 中使用反射来做到这一点。 谢谢。

【问题讨论】:

标签: reflection types uwp


【解决方案1】:

您可以使用GetTypeInfo扩展方法来获取BaceType。

Type t = typeof(int);
Type baseType = t.GetTypeInfo().BaseType; // Returns System.ValueType

【讨论】:

    猜你喜欢
    • 2019-07-23
    • 2020-10-22
    • 2019-11-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多