Billpeng Space

技术源自生活
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2013年3月7日

摘要: C# 特性详解 特性(attribute)是被指定给某一声明的一则附加的声明性信息。在C#中,有一个小的预定义特性集合。在学习如何建立我们自己的定制特性(custom attributes)之前,我们先来看看在我们的代码中如何使用预定义特性。 1 using System; 2 public class AnyClass 3 { 4 [Obsolete("Don't use Old method, use New method", true)] 5 static void Old( ) { } 6 static void New( ) { } 7 ... 阅读全文

posted @ 2013-03-07 00:13 billpeng 阅读(407) 评论(0) 推荐(0) 编辑