mardi 24 mars 2015

Create a Winforms Flowchart Control when performance matters: Set of controls / Handle everything manually (painting, user interactions, etc.)


I am currently trying to create a Flowchart / Diagram Control (e.g. NShape) and I am struggling about what to use to manage the primitives (rectangle, rounded rectangle, square, circle, etc) and their respective user interactions (drag-and-drops, re-sizing, texture, etc.).


Is it better for performance matters to use a set a control for each of them? Therefore, a dummy hierarchy with a Shape Control as a base class can designed and other related paintings and region definitions defined in sub-classes.


On one hand, the good thing is that in this way, I can provide a very simple way to handle the user interactions through the events available in the Control class. In the past, I've already had done something pretty close to this approach and that was pretty straightforward.


On the other hand, I am not sure it is really performance-wise since there is a need to create hundreds of controls and therefore a lot of handles. At the same-time, it seems like doing otherwise is like re-inventing a lot the wheel and not taking any advantage of what is already existing and the point is that I do not feel quite confident to start something brand new to make performant enough.


Any insights about what I want to achieve?


Thanks,





Aucun commentaire:

Enregistrer un commentaire