繁体   English   中英

如何禁用从父类继承的c#属性?

[英]How to disable c# Attribute that inherits from parent class?

也许这很容易,但我找不到解决办法

[ExecuteAlways] // some third party attribute
public class A  // and this class is also third party
{

}

// I don't want the ExecuteAlwasy attribute in B
// [!ExecuteAlways] < this is what I want
public class B : A
{

}

那么,如何仅删除B类的属性? 请注意,A类不可编辑。

父类A和属性[ExecuteAlways]均不可编辑。 我不相信有一种方法可以在B中禁用此属性。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM