I\'ve created attribute like
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
[Serializable]
public class TestPropertyAttribute :
Put it in the constructor instead of just as a separate property:
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
[Serializable]
public class TestPropertyAttribute : System.Attribute
{
readonly string _name;
public TestPropertyAttribute(string name)
{
_name = name;
}
public string Name { get { return _name; } }
}
I don't believe you can make it mandatory and use the Name=...
syntax when applying the attribute though.