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

时间:2019-06-28 06:29:29

标签: c# class inheritance attributes

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

[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类不可编辑。

1 个答案:

答案 0 :(得分:0)

父类A和属性[ExecuteAlways]的代码均不可编辑。我认为无法在B中禁用此属性。

相关问题