¿A qué se refiere la Inheritedpropiedad bool sobre atributos?
¿Significa que si defino mi clase con un atributo AbcAtribute(que tiene Inherited = true), y si heredo otra clase de esa clase, la clase derivada también tendrá ese mismo atributo aplicado?
Para aclarar esta pregunta con un ejemplo de código, imagina lo siguiente:
[AttributeUsage(AttributeTargets.Class, Inherited = true)]
public class Random: Attribute
{ /* attribute logic here */ }
[Random]
class Mother
{ }
class Child : Mother
{ }
¿ ChildTambién se le ha Randomaplicado el atributo?
Inheritedpropiedad tiene un ejemplo elaborado que muestra la diferencia entreInherited=trueyInherited=falsepara una clase heredada y unoverridemétodo.