public void LoadFromXml(KryptonWorkspace workspace,
XmlReader xmlReader,
UniqueNameToPage existingPages)
{
// Load the sequence details
workspace.ReadSequenceElement(xmlReader, this);
// If the sequence contains nothing then exit immediately
if (!xmlReader.IsEmptyElement)
{
do
{
// Read the next Element
if (!xmlReader.Read())
throw new ArgumentException("An element was expected but could not be read in.");
// Is this the end of the sequence
if (xmlReader.NodeType == XmlNodeType.EndElement)
break;
// Is it another sequence?
if (xmlReader.Name == "WS")
{
KryptonWorkspaceSequence sequence = new KryptonWorkspaceSequence();
sequence.LoadFromXml(workspace, xmlReader, existingPages);
Children.Add(sequence);
}
else if (xmlReader.Name == "WC")
{
KryptonWorkspaceCell cell = new KryptonWorkspaceCell();
cell.LoadFromXml(workspace, xmlReader, existingPages);
Children.Add(cell);
}
else
throw new ArgumentException("Unknown element was encountered.");
}
while (true);
}
}