Esempio n. 1
0
        public static void RoundtripDataTest()
        {
            string   expected = File.ReadAllText(@"test-files/RoundtripBinary.plist");
            NSObject value    = XmlPropertyListParser.Parse(new FileInfo(@"test-files/RoundtripBinary.plist"));
            string   actual   = value.ToXmlPropertyList();

            Assert.Equal(expected, actual, ignoreLineEndingDifferences: true);
        }
Esempio n. 2
0
        public static void RoundtripTest()
        {
            string   expected = File.ReadAllText(@"test-files/Roundtrip.plist");
            NSObject value    = XmlPropertyListParser.Parse(new FileInfo(@"test-files/Roundtrip.plist"));
            string   actual   = value.ToXmlPropertyList();

            Assert.Equal(expected, actual, false, true);
        }
Esempio n. 3
0
        /// <summary>
        /// 将plist文件转换为xml文件
        /// </summary>
        /// <param name="path">plist文件位置</param>
        /// <param name="saveToFile">是否存储转换的xml文件</param>
        /// <returns></returns>
        public string Plist2XML(string path, bool saveToFile)
        {
            FileInfo plistFileInfo = new FileInfo(path);
            NSObject plist         = PropertyListParser.Parse(plistFileInfo);
            string   xml           = plist.ToXmlPropertyList();

            if (saveToFile)
            {
                File.WriteAllText(plistFileInfo.DirectoryName + "\\" + plistFileInfo.Name + ".xml", xml);
            }
            return(xml);
        }