Is there a way to declare a setter for a clr-property that is defined in an abstract base class with only a getter (and vice versa)?
abstract class BaseClass {
public abstract string Test {
get;
}
}
class ConcreteClass : BaseClass{
public override string Test {
get { return string.Empty; }
set { /* Some code*/} // This would be really pratically
}
}
The same quesion may be asked for properties marked as virtual.
That is fortunately not possible. You cannot change an existing definition/contract.
There are ways around it, like the
newkeyword. Or using an interface.