On one place I inherit from two base classes, which is apparently not possible in c#.
Can anyone help me by suggesting a different design to work around this problem?
Here are some more details:
I have an Object class from which every widget inherits from.
Then there is the Group class which is a container and has a list of objects.
And then there is GroupObject. This is where the problem lies because it inherits from both Object and Group. It is used by classes like ChildWindow. These classes need to be drawable (the window treats child windows just like any other object) and they need to be containers (the child window will draw the widgets inside it, the window doesn't know and doesn't need to know what the child window contains).
I cannot make Group an extension on Object, because the Window is a Group and not an Object (this is the only Group which isn't an Object). And the window has to inherit from Group because every Object has a pointer to its parent which can be either a GroupObject or the Window (so a Group pointer).
Does anyone has a suggestion on how to change my design to make this work?
If you need more information or if I wasn't clear enough about something, just ask.
Thanks in advance