예제 #1
0
        // Token: 0x060001DE RID: 478 RVA: 0x00006E08 File Offset: 0x00005008
        public static string writeXml(object value)
        {
            string @string;

            using (MemoryStream memoryStream = new MemoryStream())
            {
                using (XmlWriter xmlWriter = XmlWriter.Create(memoryStream, new XmlWriterSettings
                {
                    Encoding = new UTF8Encoding(false),
                    ConformanceLevel = ConformanceLevel.Document,
                    Indent = true
                }))
                {
                    xmlWriter.WriteStartDocument();
                    xmlWriter.WriteDocType("plist", "-//Apple Computer//DTD PLIST 1.0//EN", "http://www.apple.com/DTDs/PropertyList-1.0.dtd", null);
                    xmlWriter.WriteStartElement("plist");
                    xmlWriter.WriteAttributeString("version", "1.0");
                    Plist.compose(RuntimeHelpers.GetObjectValue(value), xmlWriter);
                    xmlWriter.WriteEndElement();
                    xmlWriter.WriteEndDocument();
                    xmlWriter.Flush();
                    xmlWriter.Close();
                    @string = Encoding.UTF8.GetString(memoryStream.ToArray());
                }
            }
            return(@string);
        }
예제 #2
0
 // Token: 0x060001E6 RID: 486 RVA: 0x00007348 File Offset: 0x00005548
 private static void composeArray(List <object> value, XmlWriter writer)
 {
     writer.WriteStartElement("array");
     try
     {
         foreach (object obj in value)
         {
             object objectValue = RuntimeHelpers.GetObjectValue(obj);
             Plist.compose(RuntimeHelpers.GetObjectValue(objectValue), writer);
         }
     }
     finally
     {
         List <object> .Enumerator enumerator;
         ((IDisposable)enumerator).Dispose();
     }
     writer.WriteEndElement();
 }
예제 #3
0
 // Token: 0x060001E9 RID: 489 RVA: 0x00007718 File Offset: 0x00005918
 private static void writeDictionaryValues(Dictionary <string, object> dictionary, XmlWriter writer)
 {
     writer.WriteStartElement("dict");
     try
     {
         foreach (string text in dictionary.Keys)
         {
             object objectValue = RuntimeHelpers.GetObjectValue(dictionary[text]);
             writer.WriteElementString("key", text);
             Plist.compose(RuntimeHelpers.GetObjectValue(objectValue), writer);
         }
     }
     finally
     {
         Dictionary <string, object> .KeyCollection.Enumerator enumerator;
         ((IDisposable)enumerator).Dispose();
     }
     writer.WriteEndElement();
 }