Subclassing a view

We would like to customize the node selection outline by overriding DrawSelectOutline from the View class. We followed the basic instructions found in the KB article http://www.syncfusion.com/support/kb/diagram/Default.aspx?ToDo=view&questId=31 to subclass the view. Everything works as expected except when we save and re-open a diagram. When we re-open the diagram, we no longer have the sub-classed view and thus never make it into our derived DrawSelectOutline method. We used the DiagramBuilder sample as our starting point. I''ve attached the derived classes that we added. In order to use the derived classes, I changed the following lines of code in DiagramForm.cs to use the new classes: //this.diagramComponent = new Syncfusion.Windows.Forms.Diagram.Controls.Diagram(); this.diagramComponent = new MyDiagram(); and //this.diagramComponent = new Syncfusion.Windows.Forms.Diagram.Controls.Diagram(); this.diagramComponent = new MyDiagram(); As I said, it works for a new diagram but not a saved diagram. Hopefully we''re just making some simple mistake with the serialization. Any help as to what we''re missing would be greatly appreciated. Chris C.

Derived.zip

2 Replies

CC Chris C December 14, 2005 03:10 PM UTC

Sorry but I accidentally added the same line of code twice. The two lines of code we changed in DiagramForm.cs are: //private Syncfusion.Windows.Forms.Diagram.Controls.Diagram diagramComponent; private MyDiagram diagramComponent; and //this.diagramComponent = new Syncfusion.Windows.Forms.Diagram.Controls.Diagram(); this.diagramComponent = new MyDiagram(); Sorry for any confusion. Chris C.


AD Administrator Syncfusion Team December 15, 2005 01:35 AM UTC

Hi Chris, We were not aware of this problem. The Essential Diagram View class is no longer a serializable type and uses a special ViewInfo class for persisting the View related data. This is why the deserialization was failing to re-create your custom View. We have added a fix for this problem, and the fix will be a part of the Essential Diagram 4.0 RC that is due very shortly. Please bear with us till the RC is out. Thank you for having brought the issue to our attention. Regards, Prakash Surendra Syncfusion Inc.,

Loader.
Up arrow icon