コード例 #1
0
 internal void GetInnerXml(System.Text.StringBuilder sb, int intendation, bool isFirst = false)
 {
     if (this is XDocument && ((XDocument)this).Declaration != null)
     {
         ((XDocument)this).Declaration.GetXml(sb, intendation); isFirst = false;
     }
     foreach (object obj in mElements)
     {
         if (obj is XElement)
         {
             if (!isFirst)
             {
                 sb.AppendLine();
             }
             ((XElement)obj).GetXml(sb, intendation);
         }
         else if (obj is XComment)
         {
             if (!isFirst)
             {
                 sb.AppendLine();
             }
             ((XComment)obj).GetXml(sb, intendation);
         }
         else if (obj is string)
         {
             if (!isFirst)
             {
                 sb.AppendLine();
             }
             sb.Append(XmlParser.EncodeXml(obj.ToString()));
         }
         isFirst = false;
     }
 }
コード例 #2
0
 internal void GetXml(System.Text.StringBuilder sb)
 {
     sb.Append(" " + this.Name.ToString() + "=\"" + XmlParser.EncodeXml(this.Value) + "\"");
 }