Factory pattern and building object



I am creating a FlowChart type GUI application which has several
diagram items. I have a DiagramItemFactory which creates concrete
diagram item objects. I call this factory to create diagram items at
runtime via drag and drop, insert or other. Then I serialize my diagram
to an XML file. Everything is ok so far.


Sample C# code:
public class DiagramItemFactory
{

public DiagramItem CreateItem(DiagramItemType itemType)
{
DiagramItem diagramItem = null;
switch (itemType)
{
case DiagramItemType.Square:
Square square = new Square(); // square class
diagramItem = square;
break;

case DiagramItemType.Circle:
Circle cirlce = new Circle(); // circle class
diagramItem = square;
break;
}
return diagramItem;
}
}

My problem is when I open the file a go through the diagram items
defined in the file, I want to the DiagramItemFactory again to create
the diagram items for the diagram, but the problem is that
the factory only creates the default diagram items and the file
also contains size, color, coordinate and other properties.

Is there another pattern I should be using for opening up the file
and rendering the flow chart diagram?

Thank You,

Opa

.