当前位置: 首页>>代码示例>>C#>>正文


C# IXmlDocument.CreateCDataSection方法代码示例

本文整理汇总了C#中IXmlDocument.CreateCDataSection方法的典型用法代码示例。如果您正苦于以下问题:C# IXmlDocument.CreateCDataSection方法的具体用法?C# IXmlDocument.CreateCDataSection怎么用?C# IXmlDocument.CreateCDataSection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IXmlDocument的用法示例。


在下文中一共展示了IXmlDocument.CreateCDataSection方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DeserializeValue

 // Token: 0x060006E3 RID: 1763
 // RVA: 0x000381B4 File Offset: 0x000363B4
 private void DeserializeValue(JsonReader reader, IXmlDocument document, XmlNamespaceManager manager, string propertyName, IXmlNode currentNode)
 {
     if (propertyName != null)
     {
         if (propertyName == "#text")
         {
             currentNode.AppendChild(document.CreateTextNode(reader.Value.ToString()));
             return;
         }
         if (propertyName == "#cdata-section")
         {
             currentNode.AppendChild(document.CreateCDataSection(reader.Value.ToString()));
             return;
         }
         if (propertyName == "#whitespace")
         {
             currentNode.AppendChild(document.CreateWhitespace(reader.Value.ToString()));
             return;
         }
         if (propertyName == "#significant-whitespace")
         {
             currentNode.AppendChild(document.CreateSignificantWhitespace(reader.Value.ToString()));
             return;
         }
     }
     if (!string.IsNullOrEmpty(propertyName) && propertyName[0] == '?')
     {
         this.CreateInstruction(reader, document, currentNode, propertyName);
         return;
     }
     if (string.Equals(propertyName, "!DOCTYPE", StringComparison.OrdinalIgnoreCase))
     {
         this.CreateDocumentType(reader, document, currentNode);
         return;
     }
     if (reader.TokenType == JsonToken.StartArray)
     {
         this.ReadArrayElements(reader, document, propertyName, currentNode, manager);
         return;
     }
     this.ReadElement(reader, document, currentNode, propertyName, manager);
 }
开发者ID:newchild,项目名称:Project-DayZero,代码行数:44,代码来源:XmlNodeConverter.cs

示例2: DeserializeValue

    private void DeserializeValue(JsonReader reader, IXmlDocument document, XmlNamespaceManager manager, string propertyName, IXmlNode currentNode)
    {
      switch (propertyName)
      {
        case TextName:
          currentNode.AppendChild(document.CreateTextNode(reader.Value.ToString()));
          break;
        case CDataName:
          currentNode.AppendChild(document.CreateCDataSection(reader.Value.ToString()));
          break;
        case WhitespaceName:
          currentNode.AppendChild(document.CreateWhitespace(reader.Value.ToString()));
          break;
        case SignificantWhitespaceName:
          currentNode.AppendChild(document.CreateSignificantWhitespace(reader.Value.ToString()));
          break;
        default:
          // processing instructions and the xml declaration start with ?
          if (!string.IsNullOrEmpty(propertyName) && propertyName[0] == '?')
          {
            CreateInstruction(reader, document, currentNode, propertyName);
          }
          else
          {
            if (reader.TokenType == JsonToken.StartArray)
            {
              // handle nested arrays
              ReadArrayElements(reader, document, propertyName, currentNode, manager);
              return;
            }

            // have to wait until attributes have been parsed before creating element
            // attributes may contain namespace info used by the element
            ReadElement(reader, document, currentNode, propertyName, manager);
          }
          break;
      }
    }
开发者ID:284247028,项目名称:MvvmCross,代码行数:38,代码来源:XmlNodeConverter.cs

示例3: DeserializeValue

 private void DeserializeValue(JsonReader reader, IXmlDocument document, XmlNamespaceManager manager, string propertyName, IXmlNode currentNode)
 {
   switch (propertyName)
   {
     case "#text":
       currentNode.AppendChild(document.CreateTextNode(reader.Value.ToString()));
       break;
     case "#cdata-section":
       currentNode.AppendChild(document.CreateCDataSection(reader.Value.ToString()));
       break;
     case "#whitespace":
       currentNode.AppendChild(document.CreateWhitespace(reader.Value.ToString()));
       break;
     case "#significant-whitespace":
       currentNode.AppendChild(document.CreateSignificantWhitespace(reader.Value.ToString()));
       break;
     default:
       if (!string.IsNullOrEmpty(propertyName) && (int) propertyName[0] == 63)
       {
         this.CreateInstruction(reader, document, currentNode, propertyName);
         break;
       }
       else if (reader.TokenType == JsonToken.StartArray)
       {
         this.ReadArrayElements(reader, document, propertyName, currentNode, manager);
         break;
       }
       else
       {
         this.ReadElement(reader, document, currentNode, propertyName, manager);
         break;
       }
   }
 }
开发者ID:Zeludon,项目名称:FEZ,代码行数:34,代码来源:XmlNodeConverter.cs


注:本文中的IXmlDocument.CreateCDataSection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。