Suppose that I have a simple custom attribute:
public class MyCustomAttribute : Attribute
{
public MyCustomAttribute(string parameter1)
{
}
}
And use it to decorate a member in a class
public class Foo
{
[MyCustomAttribute("test")]
string bar;
}
When the constructor for MyCustomAttribute runs - in this example with "test" as the value of the first parameter - is it possible to get any of the metadata regarding the member that was decorated? i.e. in this example is it possible to know that the property is called 'bar' or that it is of type System.String?
I can't see how to do it - maybe I am going blind! - but it seems like that metadata should be available somewhere?