I've got some aspect like this:
public class MyAttribute : OnMethodInvocationAspect
{
public int Offset { get; internal set; }
public MyAttribute(int offset)
{
this.Offset = offset;
}
public override void OnInvocation(MethodInvocationEventArgs eventArgs)
{
//do some stuff
}
}
Now I'm having my class, and I add my attribute to it:
class MyClass
{
[MyAttribute(0x10)]
public int MyProp { get; set; }
}
Works all fine. Yet now I want to use reflection to get my offset; when I do
typeof(MyClass).GetProperty("MyProp").GetCustomAttributes(true);
It returns nothing. How can I access my original Offset value (the property on my attribute)?