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


C# IXmlDocument.CreateXmlDocumentType方法代码示例

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


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

示例1: CreateDocumentType

        private void CreateDocumentType(JsonReader reader, IXmlDocument document, IXmlNode currentNode)
        {
            string name = null;
            string publicId = null;
            string systemId = null;
            string internalSubset = null;
            while (reader.Read() && reader.TokenType != JsonToken.EndObject)
            {
                switch (reader.Value.ToString())
                {
                    case "@name":
                        reader.Read();
                        name = reader.Value.ToString();
                        break;
                    case "@public":
                        reader.Read();
                        publicId = reader.Value.ToString();
                        break;
                    case "@system":
                        reader.Read();
                        systemId = reader.Value.ToString();
                        break;
                    case "@internalSubset":
                        reader.Read();
                        internalSubset = reader.Value.ToString();
                        break;
                    default:
                        throw new JsonSerializationException("Unexpected property name encountered while deserializing XmlDeclaration: " + reader.Value);
                }
            }

            IXmlNode documentType = document.CreateXmlDocumentType(name, publicId, systemId, internalSubset);
            currentNode.AppendChild(documentType);
        }
开发者ID:Henry-T,项目名称:UnityPG,代码行数:34,代码来源:XmlNodeConverter.cs

示例2: CreateDocumentType

 // Token: 0x060006EA RID: 1770
 // RVA: 0x00038974 File Offset: 0x00036B74
 private void CreateDocumentType(JsonReader reader, IXmlDocument document, IXmlNode currentNode)
 {
     string name = null;
     string publicId = null;
     string systemId = null;
     string internalSubset = null;
     while (reader.Read())
     {
         if (reader.TokenType == JsonToken.EndObject)
         {
             break;
         }
         string a;
         if ((a = reader.Value.ToString()) != null)
         {
             if (a == "@name")
             {
                 reader.Read();
                 name = reader.Value.ToString();
                 continue;
             }
             if (a == "@public")
             {
                 reader.Read();
                 publicId = reader.Value.ToString();
                 continue;
             }
             if (a == "@system")
             {
                 reader.Read();
                 systemId = reader.Value.ToString();
                 continue;
             }
             if (a == "@internalSubset")
             {
                 reader.Read();
                 internalSubset = reader.Value.ToString();
                 continue;
             }
         }
         throw new JsonSerializationException("Unexpected property name encountered while deserializing XmlDeclaration: " + reader.Value);
     }
     IXmlNode newChild = document.CreateXmlDocumentType(name, publicId, systemId, internalSubset);
     currentNode.AppendChild(newChild);
 }
开发者ID:newchild,项目名称:Project-DayZero,代码行数:47,代码来源:XmlNodeConverter.cs


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