与Reflection
你可以得到一个特定的命名空间的类的数量,像这样的财产以后帮助我的人:
int num = (from cal in Assembly.GetExecutingAssembly().GetTypes()
where cal.Namespace == "ProjNameSpace" && cal.IsClass
select cal).ToList().Count();
Run Code Online (Sandbox Code Playgroud)
要么
AppDomain.CurrentDomain
.GetAssemblies()
.SelectMany(cyp => typ.GetTypes())
.Where(cal => cal.IsClass && cal.Namespace == "ProjNameSpace")
.ToList().Count();
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1972 次 |
最近记录: |