有没有办法让在C#innerclasses的名单?没有办法、名单、innerclasses

由网友(你是我的单曲循环)分享简介:按照标题。我想所有的内部类给定类的列表,也可以是名称的列表或一个类型列表 - 我不是大惊小怪。这可能吗?我想有可能是使用反射的方式,但一直没能找到一个。As per the title. I'd like a list of all the inner classes of a given class, it can...

按照标题。我想所有的内部类给定类的列表,也可以是名称的列表或一个类型列表 - 我不是大惊小怪。这可能吗?我想有可能是使用反射的方式,但一直没能找到一个。

As per the title. I'd like a list of all the inner classes of a given class, it can be a list of names or a list of types - I am not fussed. Is this possible? I thought there might be a way using reflection but haven't been able to find one.

非常感谢, 托马斯

推荐答案

您想要 Type.GetNestedTypes 。这会给你的类型,然后你就可以查询自己的名字列表。

You want Type.GetNestedTypes. This will give you the list of types, which you can then query for their names.

阅读全文

相关推荐

最新文章