T
Tony Nassar
Could someone clarify why this doesn't work? Is there a persuasive reason
why it shouldn't?
interface IGetOnly {
string Name { get; }
}
interface IGetAndSet : IGetOnly {
string Name { set; }
}
It should be clear what I want to do here: extend the interface IGetOnly
with a setter. I know that the getter is implemented as get_Name, but I then
have a class that implements IGetAndSet, it does *not* have a getter. If I
add a getter to the second interface declaration, I have a conflict over
"Name", which I have to resolve by using "new." But the getter isn't new! I
can declare get_Name and set_Name directly, but that doesn't work (I'll
spare the readers the details).
why it shouldn't?
interface IGetOnly {
string Name { get; }
}
interface IGetAndSet : IGetOnly {
string Name { set; }
}
It should be clear what I want to do here: extend the interface IGetOnly
with a setter. I know that the getter is implemented as get_Name, but I then
have a class that implements IGetAndSet, it does *not* have a getter. If I
add a getter to the second interface declaration, I have a conflict over
"Name", which I have to resolve by using "new." But the getter isn't new! I
can declare get_Name and set_Name directly, but that doesn't work (I'll
spare the readers the details).