SaveToXml() public method

Request this sequence save its information about children.
public SaveToXml ( KryptonWorkspace workspace, XmlWriter xmlWriter ) : void
workspace KryptonWorkspace Reference to owning workspace instance.
xmlWriter System.Xml.XmlWriter Xml writer to save information into.
return void
Beispiel #1
0
        /// <summary>
        /// Request this sequence save its information about children.
        /// </summary>
        /// <param name="workspace">Reference to owning workspace instance.</param>
        /// <param name="xmlWriter">Xml writer to save information into.</param>
        public void SaveToXml(KryptonWorkspace workspace, XmlWriter xmlWriter)
        {
            // Output standard values appropriate for all Sequence instances
            xmlWriter.WriteStartElement("WS");
            workspace.WriteSequenceElement(xmlWriter, this);

            // Persist each child sequence/cell in turn
            foreach (object child in Children)
            {
                KryptonWorkspaceSequence sequence = child as KryptonWorkspaceSequence;
                if (sequence != null)
                {
                    sequence.SaveToXml(workspace, xmlWriter);
                }

                KryptonWorkspaceCell cell = child as KryptonWorkspaceCell;
                if (cell != null)
                {
                    cell.SaveToXml(workspace, xmlWriter);
                }
            }

            // Terminate the workspace element
            xmlWriter.WriteEndElement();
        }