hun*_*ter 11
您可以使用Reflection和LINQ查询轻松找到它们
var type = typeof(IRyuDice);
var types = AppDomain.CurrentDomain.GetAssemblies().ToList()
.SelectMany(a => a.GetTypes())
.Where(t => type.IsAssignableFrom(t));
Run Code Online (Sandbox Code Playgroud)
AppDomain.CurrentDomain.GetAssemblies返回一个System.Reflection.Assembly[]集合.然后选择该程序集中的所有类型,并检查该类型是否使用了您的接口.
http://msdn.microsoft.com/en-us/library/system.appdomain.getassemblies.aspx
| 归档时间: |
|
| 查看次数: |
4111 次 |
| 最近记录: |