Пример #1
0
        internal XmlElement ToXme()
        {
            var xmd     = new XmlDocument();
            var section = xmd.CreateElement("Section");

            var ownerDocument = section.OwnerDocument;

            if (ownerDocument == null)
            {
                throw new NullReferenceException("ownerDocument");
            }

            if (_name != null)
            {
                section.SetAttribute("Name", Name);
            }

            if (_margin != null)
            {
                var xmeMargin       = Margin.ToXme("Margin");
                var importedSection = ownerDocument.ImportNode(xmeMargin, true);
                section.AppendChild(importedSection);
            }

            if (_defaultFont != null)
            {
                var xmeDefaultFont      = DefaultFont.ToXme("DefaultFont");
                var importedDefaultFont = ownerDocument.ImportNode(xmeDefaultFont, true);
                section.AppendChild(importedDefaultFont);
            }

            var header         = Header.ToXme();
            var importedHeader = ownerDocument.ImportNode(header, true);

            section.AppendChild(importedHeader);

            var pane         = Pane.ToXme();
            var importedPane = ownerDocument.ImportNode(pane, true);

            section.AppendChild(importedPane);

            var footer         = Footer.ToXme();
            var importedFooter = ownerDocument.ImportNode(footer, true);

            section.AppendChild(importedFooter);

            return(section);
        }