From the sample, which is found in the installed folder
C:\Program Files\MindFusion\FlowChart.NET Professional Edition\VS2005 (.NET 2.0)\Samples\VB.NET\Fishbone
I saved the diagram into xml, when loading back the xml I get the following error. Could you please review the code and let me know what is the reason for this problem?
"Failed to Instantiate item of type 'Fishbone.CauseNode' . "
Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
MindFusion.Diagramming.Diagram.RegisterItemClass(GetType(CauseNode), GetType(CauseNode).Name, 1)
MindFusion.Diagramming.Diagram.RegisterItemClass(GetType(AspectNode), GetType(AspectNode).Name, 1)
MindFusion.Diagramming.Diagram.RegisterItemClass(GetType(FishboneBehavior), GetType(FishboneBehavior).Name, 1)
diagram.ShadowsStyle = ShadowsStyle.None
backbone = diagram.Factory.CreateShapeNode( _
0, 60, 300, 1.5F, Shapes.Rectangle)
backbone.Brush = New SolidBrush(Color.Black)
backbone.EnabledHandles = AdjustmentHandles.None
backbone.HandlesStyle = HandlesStyle.Invisible
diagramView.CustomBehavior = New Fishbone.FishboneBehavior(diagramView, backbone)
End Sub
Dim backbone As ShapeNode
Private Sub diagram_NodeCreated(ByVal sender As Object, ByVal e As MindFusion.Diagramming.NodeEventArgs) Handles diagram.NodeCreated
If TypeOf e.Node Is Fishbone.CauseNode Then
e.Node.Constraints.MoveDirection = DirectionConstraint.Horizontal
End If
End Sub
Private Sub miSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles miSave.Click
diagramView.SaveToXml(dlgSaveFile.FileName)
End Sub
Private Sub miOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles miOpen.Click
diagram.ClearAll()
Try
diagramView.LoadFromXml(dlgOpenFile.FileName)
Catch ex As Exception
' Failed to Instantiate item of type 'Fishbone.CauseNode' .
MessageBox.Show(ex.Message, ex.Source)
End Try
End Sub