compose() private static method

private static compose ( object value, XmlWriter writer ) : void
value object
writer System.Xml.XmlWriter
return void
Ejemplo n.º 1
0
        // Token: 0x06000108 RID: 264 RVA: 0x00006B20 File Offset: 0x00004D20
        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(value, xmlWriter);
                    xmlWriter.WriteEndElement();
                    xmlWriter.WriteEndDocument();
                    xmlWriter.Flush();
                    xmlWriter.Close();
                    @string = Encoding.UTF8.GetString(memoryStream.ToArray());
                }
            }
            return(@string);
        }
 private static void composeArray(List <object> value, XmlWriter writer)
 {
     writer.WriteStartElement("array");
     foreach (object obj in value)
     {
         Plist.compose(obj, writer);
     }
     writer.WriteEndElement();
 }
Ejemplo n.º 3
0
 // Token: 0x06000113 RID: 275 RVA: 0x00007454 File Offset: 0x00005654
 private static void writeDictionaryValues(Dictionary <string, object> dictionary, XmlWriter writer)
 {
     writer.WriteStartElement("dict");
     foreach (string current in dictionary.Keys)
     {
         object value = dictionary[current];
         writer.WriteElementString("key", current);
         Plist.compose(value, writer);
     }
     writer.WriteEndElement();
 }
 private static void writeDictionaryValues(Dictionary <string, object> dictionary, XmlWriter writer)
 {
     writer.WriteStartElement("dict");
     foreach (string key in dictionary.Keys)
     {
         object obj = dictionary[key];
         writer.WriteElementString("key", key);
         XmlWriter writer1 = writer;
         Plist.compose(obj, writer1);
     }
     writer.WriteEndElement();
 }