We have a custom attribute
[AttributeUsage(AttributeTargets.All, AllowMultiple = true)]
public class CustomDesignerAttribute: Attribute
then we have a base class decorated with this attribute
[CustomDesigner(someKey, someValue)]
public class BaseClass
then we have a class derived from this one, decorated with same attribute (with same key, different value)
[CustomDesigner(someKey, someOtherValue)]
public class ChildClass : BaseClass
Is there possibility that ChildClass don't create a duplicate of attribute but overwrite a value for existing key instead (overwrites whole parent attribute)?
If not, what's the best pattern for getting default value from BaseClass if ChildClass has not defined his own?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…