本文整理汇总了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);
}
示例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);
}