hello,
I'm trying your ERM Diagram 4.x product.
I create a complex shape,
class ActionShape:ComplexShape
{
public String vActionType = "";
public String vActionSecType = "";
public ActionShape(String actionType, String secType,int seq)
{
vActionType = actionType;
//Set the shape appearance
Size = new SizeF(120, 100);
BorderWidth = 2;
//Add the internal applicationshape
SolidElement action = new SolidElement();
action.Location = new PointF(10, 10);
action.Height = 25;
action.Label = new TextLabel();
action.Label.Color = Color.Blue;
action.Label.Text = vActionType+"-"+secType;
Children.Add("action", action);
//Add another subshape
action = new SolidElement();
action.Location = new PointF(this.Width/2-25, this.Height-30);
action.Height = 25;
action.Width = 50;
action.Label = new TextLabel();
action.Label.Text = seq.ToString();
Children.Add("actionSeq", action);
}
}
and then I add the complex shape to the flowchart,
when I tryed to save the flowchart with
public void SaveToXml(String filename)
{
this.flowchart1.Save(@"c:\test.xml", SaveFormat.Xml);
}
then it popup an error say that, the class ActionShape is not marked as serializable.
when I add [Serializable] at head of ActionShape
as following:
[Serializable]
class ActionShape:ComplexShape
{
.......
}
then, It can save,
but when I load it with the following code:
public void LoadFromXml(String filename)
{
this.flowchart1.Open(filename);
}
then, it report that:
未找到反序列化“WindowsApplication2.ActionShape”类型对象的构造函数。
means:can not find the deserialization "WindowsApplication2.ActionShape" class's constructor function.
How should I do?
Best Regards
----------------
weiqiang