Is it possible to have an abstract property which returns a type defined in the derived class:
abstract class baseClass
{
public abstract e_Type type { get; }
}
class derived : baseClass
{
public enum e_Type
{
type1,
type2
}
private e_Type _type;
public e_Type type { get { return _type; } }
}
or must I return an int and map it in the derived class. Any other suggestions welcome.
Sure you can:
You don’t even need to declare it as abstract:
which you can then use as: