J
Jeff Gaines
I am writing a couple of text editors - one for RTF, the other for plain
text.
It seemed a good idea to make the base class (inherited from User Control)
Abstract and then deriving the 2 editors from it each with slightly
different properties. That way I can't create an instance of the base
class, I have to choose from either a text editor or an RTF editor.
Does that design strategy make sense?
I have run into a couple of issues.
VS throws up an error in design mode saying it needs to create an instance
of the base class but can't because it is abstract. Should I just ignore
that? I'm not clear as to why it should need to create an instance of the
base class.
There is a property in the base class allowing the Status Strip to be
shown/hidden. It doesn't have a backing field, it just toggles the Status
Strip between visible or not. In my test app I have a tab control with an
instance of the RTF editor on one tab and an instance of the text editor
on another. When I turn on the Status Strip in one control it turns it off
in the other! I am struggling to get my head round that, surely changing a
property in a derived class shouldn't cause the change to propagate up to
the base and then back down to all derived classes?
Would appreciate any thoughts.
text.
It seemed a good idea to make the base class (inherited from User Control)
Abstract and then deriving the 2 editors from it each with slightly
different properties. That way I can't create an instance of the base
class, I have to choose from either a text editor or an RTF editor.
Does that design strategy make sense?
I have run into a couple of issues.
VS throws up an error in design mode saying it needs to create an instance
of the base class but can't because it is abstract. Should I just ignore
that? I'm not clear as to why it should need to create an instance of the
base class.
There is a property in the base class allowing the Status Strip to be
shown/hidden. It doesn't have a backing field, it just toggles the Status
Strip between visible or not. In my test app I have a tab control with an
instance of the RTF editor on one tab and an instance of the text editor
on another. When I turn on the Status Strip in one control it turns it off
in the other! I am struggling to get my head round that, surely changing a
property in a derived class shouldn't cause the change to propagate up to
the base and then back down to all derived classes?
Would appreciate any thoughts.