At MSDN an example to write a custom attribute shows the following strange behavior
[AttributeUsage(AttributeTargets.All)]
public class MyAttribute : Attribute
{
public virtual string Name
{
get {return name;}
}
// Define Level property.
// This is a read-only attribute.
public virtual string Level
{
get {return level;}
}
// Define Reviewed property.
// This is a read/write attribute.
public virtual bool Reviewed
{
get {return reviewed;}
set {reviewed = value;}
}
}
Why all properties are virtual?