static void Main()
{
ObsoleteMethods(Assembly.Load("mscorlib.dll"));
Console.ReadKey();
}
private static void ObsoleteMethods(Assembly assembly)
{
var query = from type in assembly.GetExportedTypes().AsParallel()
from method in type.GetMethods(BindingFlags.Public | BindingFlags.Static | BindingFlags.Static)
let obsoleteAttrType = typeof(ObsoleteAttribute)
where Attribute.IsDefined(method, obsoleteAttrType)
orderby type.FullName
let obsoleteAttrObj = (ObsoleteAttribute)Attribute.GetCustomAttribute(method, obsoleteAttrType)
select string.Format("Type={0} \n Mehthod={1} \n Message={2} \n ", type.FullName, method, obsoleteAttrObj.Message);
foreach (var item in query)
Console.WriteLine(item);
//query.ForAll(a => Console.WriteLine(a)); //让多个线程同时调用Console反而损害性能,因为Console在内部进行线程同步
//query.Distinct().AsOrdered();
//query.OrderBy(a => a.Length).AsUnordered();
//query.WithExecutionMode(ParallelExecutionMode.ForceParallelism);
//query.WithMergeOptions(ParallelMergeOptions.AutoBuffered);
}

最新文章

  1. File类使用小结
  2. 求数组的长度 C
  3. 20.(转)Android的样式(Style)和主题(Theme)
  4. 配置mybatis流程
  5. java dos下中文乱码
  6. [Android]The connection to adb is down, and a severe error has occured.
  7. objective-c 关键字和概念
  8. 介绍一个python的新的web framework——karloop框架
  9. liunx tomcat多站点配置
  10. 飞天熊猫游戏源代码android文本
  11. wpf阻止键盘快捷键alt+space,alt+F4
  12. 众说纷纭的ul、ol、li
  13. 阿里云ECS服务器部署Node.js项目全过程详解
  14. wsgi 协议
  15. java类文件
  16. PHP常见错误级别及错误码
  17. Etcd源码解析(转)
  18. 移动端调试利器之vconsole
  19. Spring Boot 概述
  20. SDN前瞻 传统网络的缺陷

热门文章

  1. linux设备驱动程序_hello word 模块编译各种问题集锦
  2. The Breakpoint will not currently be hit. No executable code associated with this line
  3. springmvc20170322
  4. 技术的止境(客户价值第一,快速实现第二,边做边学,迅速成为牛人。紧贴客户的需求去做技术,立于不败之地。追求的目标:把一项产品去做好,用产品去养活自己和家人)good
  5. WebSocket握手总结
  6. IDEA Spark Streaming 操作(套接字流)-----make socket数据源
  7. 8.4 IP地址的划分及子网划分
  8. jQuery Validate插件实现表单强大的验证功能
  9. Mac 终端执行JavaScript
  10. [Swift通天遁地]二、表格表单-(9)快速创建一个美观强大的表单