【发布时间】:2011-11-03 14:53:04
【问题描述】:
我创建了自己的属性来装饰我的对象。
[AttributeUsage(AttributeTargets.All)]
public class MyCustomAttribute : System.Attribute { }
当我尝试使用 TypeDescriptor.GetProperties 传入我的自定义属性时,它不会返回任何内容,即使该类型是用该属性修饰的。
var props = TypeDescriptor.GetProperties(
type,
new[] { new Attributes.FlatLoopValueInjection()});
如何让 TypeDescriptor.GetProperties 识别我的自定义类型?
【问题讨论】:
标签: .net custom-attributes typedescriptor