摘要: 首先是定义,MSDN上是这样写的:确定可以如何使用自定义属性类。AttributeUsage是一个可应用于自定义属性定义的属性,自定义属性定义来控制如何应用新属性。 它可以通过标记的方式来修饰各种成员。下面有一个简单的例子:View Code class Program { static void Main(string[] args) { Type t=typeof(Test); var student=t.GetCustomAttributes(typeof(StudentAttribute),false); ... 阅读全文
posted @ 2012-11-07 17:17 世界很灰暗 阅读(1202) 评论(0) 推荐(0) 编辑