Пример #1
0
        private XmlNodeBuilder MakeRoot(XmlDocument workXml)
        {
            XmlNodeBuilder root = new XmlNodeBuilder(_rootName, workXml);

            root.AddAttributes(RootAttrs);
            return(root);
        }
Пример #2
0
            public XmlNode ToXml(XmlDocument doc)
            {
                XmlNodeBuilder node = new XmlNodeBuilder(Name, doc);

                node.AddAttributes(Attrs);
                return(node);
            }
Пример #3
0
        private XmlNode BuildNode(XmlDocument doc)
        {
            XmlNodeBuilder builder = new XmlNodeBuilder("error", doc);

            builder.AddAttribute("message", _error.Message);
            builder.AddAttribute("detail", _error.TargetSite == null ? _error.HelpLink : _error.HelpLink + "\n" + _error.TargetSite);
            builder.AddAttribute("source", _error.Source);
            builder.AddAttribute("stackTrace", _error.StackTrace);

            if (null != _error.InnerException)
            {
                ErrorDocument innerDoc = new ErrorDocument(_error.InnerException);
                ((XmlNode)builder).AppendChild(innerDoc.BuildNode(doc));
            }

            return(builder);
        }