I have a generic interface like this:
public interface IHardwareProperty<T>{
bool Read();
bool Write();
}
Which is "passed through" an abstract base class:
public abstract class HardwareProperty<T>:IHardwareProperty<T>{
//Paritally implements IHardwareProperty (NOT SHOWN), and passes Read and Write through
//as abstract members.
public abstract bool Read();
public abstract bool Write();
}
and is completed in several inheriting classes that use different generic arguments
CompletePropertyA:IHardwareProperty<int>
{
//Implements Read() & Write() here
}
CompletePropertyBL:IHardwareProperty<bool>
{
//Implements Read() & Write() here
}
I'd Like to store a bunch of completed properties of different types in the same collection.
Is there a way to do this without resorting to having a collection of object
s?