[Edited for additional clarity]
I have an abstract class where I've defined a property - let's call it 'BulkValueSet'. BulkValueSet is a class which holds a large number of numeric values.
public abstract class Parent
{
public BulkValueSet ValueSet {get;set;}
// additional properties and methods
}
BulkValueSet implements several different interfaces. Let's take two of them called ISpecificValueSetA and ISpecificValueSetB.
public class BulkValueSet : ISpecificValueSetA , ISpecificValueSetB
{
// lots of numbers !
}
Now for the crux of the matter: I have two child classes (ChildA and ChildB) that inherit from the Parent class. I would like for these classes to inherit the BulkValueSet property from the Parent class but modify it via the interfaces defined. I've tried hiding the parent property by using the new keyword
public class ChildA : Parent
{
new public ISpecificValueSetA ValueSet {get;set;}
// additional stuff
}
public class ChildB : Parent
{
new public ISpecificValueSetB ValueSet {get;set;}
// additional stuff
}
the intent being that the property read from the child classes returns the filtered values as provided by the relevant interface. But this isn't really working - Visual studio shows both parent and child properties as being present and accessible and accessing the 'ValueSet' property using the dot operator seems to default to the property defined in the Parent class.
How can I go about this ?
Edit: Adding some additional context - I want to do this with multiple child classes - each with their own interface implementation of BulkValueSet.