locked
Architecture of graphical component RRS feed

  • Question

  • I make such graphical component http://rghost.ru/5182838 in C# WinForms. I am interested in structure of class of this component (may be its object model), which is good for Observer realzation. The active elements of this component is small circles (color switching), I,U and chart (changing value), the rest is the passive. This component will receive messages from object collection according to collection of  small circles, I,U and chart. Please, help with this architecture.

    Thursday, April 14, 2011 8:39 AM

All replies

  • I make such graphical component http://rghost.ru/5182838 in C# WinForms. I am interested in structure of class of this component (may be its object model), which is good for Observer realzation. The active elements of this component is small circles (color switching), I,U and chart (changing value), the rest is the passive. This component will receive messages from object collection according to collection of  small circles, I,U and chart. Please, help with this architecture.

    • Merged by Helen Zhou Wednesday, April 20, 2011 7:42 AM duplicated post but wrong forum
    Thursday, April 14, 2011 10:58 AM
  • This can be made advanced or simple depending on the need for scalability, flexibility and so on. 
    A basic design would include a graphics host that provides the surface to be drawn and that controls drawing of sub graphics. It would need a collection where sub graphics could be added such as circles, charts or whatever. Provide the basics for a sub graphic using an abstract class or interface. Through this interface the host can render the graphic but also query the size of it and any other common functionality shared by individual graphics.
    Each sub graphics would have its own rendering implementation and hold its own state (such as what color, or chart data). The graphic would need a way to tell the host that it need to be redrawn. Data updates should be done to the individual sub graphic objects, not through some common component.

    There is a lot to think about, but most important is to get started. You can always change the design along the way.

    /Calle 


    - Still confused, but on a higher level -
    • Proposed as answer by Helen Zhou Wednesday, April 20, 2011 7:36 AM
    • Unproposed as answer by Helen Zhou Wednesday, April 20, 2011 7:37 AM
    Thursday, April 14, 2011 6:35 PM
  • I read the question several times and followed the link.

    I don't understand the question.

    Is it just supposed to change the colour of the circles, or what?

    Presumably you haven't written this?

    I have the impression that WPF would probably be better suited than winforms.

    Friday, April 15, 2011 10:57 AM
  • Hi xor_zet,

    This question is off topic here. I will merge it to the duplicated one in Architecture forum to get better help.

    Best wishes,

     


    Helen Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, April 20, 2011 7:42 AM