【发布时间】:2016-12-07 12:55:12
【问题描述】:
使用 Roslyn,我如何找到属性的构造函数的值?因此,给定以下具有属性的类:
[Example(typeof(ClassFromAnotherDll))]
public class ExampleClass
{
public int JustANumber { get; set; }
}
ExampleAttribute 看起来像这样(尽管来源与上述解决方案不同):
public class ExampleAttribute : Attribute
{
private readonly Type _type;
public ExampleAttribute(Type type)
{
_type = type;
}
}
我如何获得有关 ClassFromAnotherDll 类型的信息(例如属性、构造函数)?
【问题讨论】: