var allMethods = typeof(AnyClass).Assembly
.GetTypes()
.SelectMany(type => type.GetMethods());
var allMethodNames = allMethods.Select(method => method.Name);
Console.WriteLine( string.Join(Environment.NewLine, allMethodNames) );
Run Code Online (Sandbox Code Playgroud)
要检查许多程序集,请使用下一个代码:
Assembly[] assembliesToInspect = {
typeof(AnyClass).Assembly,
typeof(ClassFromAnotherAssembly).Assembly
};
var allMethods = assembliesToInspect.SelectMany(assembly => assembly.GetTypes())
.SelectMany(type => type.GetMethods());
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
58 次 |
最近记录: |