My question is there any way to retrieve the parameter list with its value using Reflection?
I want to use reflection to get the parameter list from the PropertyInfo.
Author author = (Author)attribute;
string name = author.name;
is not OK. As there will be many Attribute, which is not typeof Author.
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property, AllowMultiple = true)]
public class Author : Attribute
{
public Author(string name, int v)
{
this.name = name;
version = v;
}
public double version;
public string name;
}
public class TestClass
{
[Author("Bill Gates", 2)]
public TextBox TestPropertyTextBox { get; set; }
}