private void DeserializeValue(JsonReader reader, IXmlDocument document, XmlNamespaceManager manager, string propertyName, IXmlNode currentNode) { switch (propertyName) { case "#text": currentNode.AppendChild(document.CreateTextNode(reader.Value.ToString())); return; case "#cdata-section": currentNode.AppendChild(document.CreateCDataSection(reader.Value.ToString())); return; case "#whitespace": currentNode.AppendChild(document.CreateWhitespace(reader.Value.ToString())); return; case "#significant-whitespace": currentNode.AppendChild(document.CreateSignificantWhitespace(reader.Value.ToString())); return; } if (!string.IsNullOrEmpty(propertyName) && propertyName[0] == '?') { CreateInstruction(reader, document, currentNode, propertyName); } else if (reader.TokenType == JsonToken.StartArray) { ReadArrayElements(reader, document, propertyName, currentNode, manager); } else { ReadElement(reader, document, currentNode, propertyName, manager); } }
private void DeserializeValue(JsonReader reader, IXmlDocument document, XmlNamespaceManager manager, string propertyName, IXmlNode currentNode) { if (propertyName == null) { if (string.IsNullOrEmpty(propertyName) || propertyName[0] != '?') { if (reader.TokenType == JsonToken.StartArray) { this.ReadArrayElements(reader, document, propertyName, currentNode, manager); return; } this.ReadElement(reader, document, currentNode, propertyName, manager); } else { this.CreateInstruction(reader, document, currentNode, propertyName); } return; } else if (propertyName == "#text") { currentNode.AppendChild(document.CreateTextNode(reader.Value.ToString())); } else if (propertyName == "#cdata-section") { currentNode.AppendChild(document.CreateCDataSection(reader.Value.ToString())); } else if (propertyName == "#whitespace") { currentNode.AppendChild(document.CreateWhitespace(reader.Value.ToString())); } else { if (propertyName != "#significant-whitespace") { if (string.IsNullOrEmpty(propertyName) || propertyName[0] != '?') { if (reader.TokenType == JsonToken.StartArray) { this.ReadArrayElements(reader, document, propertyName, currentNode, manager); return; } this.ReadElement(reader, document, currentNode, propertyName, manager); } else { this.CreateInstruction(reader, document, currentNode, propertyName); } return; } currentNode.AppendChild(document.CreateSignificantWhitespace(reader.Value.ToString())); } }
private void DeserializeValue(JsonReader reader, IXmlDocument document, XmlNamespaceManager manager, string propertyName, IXmlNode currentNode) { if (propertyName != null) { if (XmlNodeConverter.< > f__switch$map0 == null) { Dictionary <string, int> dictionary = new Dictionary <string, int>(4); dictionary.Add("#text", 0); dictionary.Add("#cdata-section", 1); dictionary.Add("#whitespace", 2); dictionary.Add("#significant-whitespace", 3); XmlNodeConverter.< > f__switch$map0 = dictionary; } int num; if (XmlNodeConverter.< > f__switch$map0.TryGetValue(propertyName, ref num)) { switch (num) { case 0: currentNode.AppendChild(document.CreateTextNode(reader.Value.ToString())); return; case 1: currentNode.AppendChild(document.CreateCDataSection(reader.Value.ToString())); return; case 2: currentNode.AppendChild(document.CreateWhitespace(reader.Value.ToString())); return; case 3: currentNode.AppendChild(document.CreateSignificantWhitespace(reader.Value.ToString())); return; } } } if (!string.IsNullOrEmpty(propertyName) && propertyName.get_Chars(0) == '?') { this.CreateInstruction(reader, document, currentNode, propertyName); } else { if (reader.TokenType == JsonToken.StartArray) { this.ReadArrayElements(reader, document, propertyName, currentNode, manager); return; } this.ReadElement(reader, document, currentNode, propertyName, manager); } }
private void DeserializeValue( JsonReader reader, IXmlDocument document, XmlNamespaceManager manager, string propertyName, IXmlNode currentNode) { if (!(propertyName == "#text")) { if (!(propertyName == "#cdata-section")) { if (!(propertyName == "#whitespace")) { if (propertyName == "#significant-whitespace") { currentNode.AppendChild(document.CreateSignificantWhitespace(this.ConvertTokenToXmlValue(reader))); } else if (!string.IsNullOrEmpty(propertyName) && propertyName[0] == '?') { this.CreateInstruction(reader, document, currentNode, propertyName); } else if (string.Equals(propertyName, "!DOCTYPE", StringComparison.OrdinalIgnoreCase)) { this.CreateDocumentType(reader, document, currentNode); } else if (reader.TokenType == JsonToken.StartArray) { this.ReadArrayElements(reader, document, propertyName, currentNode, manager); } else { this.ReadElement(reader, document, currentNode, propertyName, manager); } } else { currentNode.AppendChild(document.CreateWhitespace(this.ConvertTokenToXmlValue(reader))); } } else { currentNode.AppendChild(document.CreateCDataSection(this.ConvertTokenToXmlValue(reader))); } } else { currentNode.AppendChild(document.CreateTextNode(this.ConvertTokenToXmlValue(reader))); } }
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; } }
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; } }
// 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); }
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; } } }