Inherited属性上的bool属性是指什么?
这是否意味着如果我使用属性AbcAtribute(有Inherited = true)定义我的类,并且如果我从该类继承另一个类,那么派生类也将应用相同的属性?
要使用代码示例澄清此问题,请想象以下内容:
[AttributeUsage(AttributeTargets.Class, Inherited = true)]
public class Random: Attribute
{ /* attribute logic here */ }
[Random]
class Mother
{ }
class Child : Mother
{ }
Run Code Online (Sandbox Code Playgroud)
是否Child也Random应用了属性?