コード例 #1
0
 protected override void WriteCommentImpl(string comment)
 {
     if (!string.IsNullOrEmpty(comment))
     {
         Cursor.AppendChild(Document.CreateComment(comment));
     }
 }
コード例 #2
0
 protected override void AppendElement(XmlElement e)
 {
     // if there is a node in scope, add the element after it and use it as the new scope
     if (Cursor != null)
     {
         Cursor.AppendChild(e);
     }
     else             // if there is no XML node in scope, assume we're adding to the root
     {
         Document.AppendChild(e);
     }
 }
コード例 #3
0
        protected override void NestElement(XmlElement e, out XmlElement oldCursor)
        {
            oldCursor = null;

            if (Cursor != null)
            {
                Cursor.AppendChild(e);

                oldCursor = Cursor;
                Cursor    = e;
            }
            else             // if there is no XML node in scope, assume we're adding to the root
            {
                Document.DocumentElement.AppendChild(e);
                Cursor = e;
            }
        }