コード例 #1
0
 public Backup(string path)
 {
     if (File.Exists(path + "/Info.plist"))
     {
         PList backup = new PList(path + "/Info.plist");
         ios                  = new iOS();
         device               = new Device();
         name                 = new DirectoryInfo(path).Name;
         this.path            = path;
         date                 = backup.First(s => s.Key == "Last Backup Date").Value;
         ios.buildNumber      = backup.First(s => s.Key == "Build Version").Value;
         ios.version          = backup.First(s => s.Key == "Product Version").Value;
         ios.name             = MainForm.iOSVersionsList.First(s => s.version == ios.version).name;
         device.deviceName    = backup.First(s => s.Key == "Device Name").Value;
         device.deviceType    = backup.First(s => s.Key == "Product Name").Value;
         device.deviceVersion = backup.First(s => s.Key == "Product Type").Value;
     }
     else
     {
         throw new ArgumentException("\"Info.plist\" not found");
     }
 }
コード例 #2
0
        private dynamic ParseValue(XElement val)
        {
            switch (val.Name.ToString())
            {
            case "string":
                return(val.Value);

            case "integer":
                return(int.Parse(val.Value));

            case "real":
                return(float.Parse(val.Value));

            case "true":
                return(true);

            case "false":
                return(false);

            case "dict":
                PList plist = new PList();
                Parse(plist, val.Elements());
                return(plist);

            case "array":
                List <dynamic> list = ParseArray(val.Elements());
                return(list);

            case "data":
                return(val.Value);

            case "date":
                return(DateTime.Parse(val.Value));

            default:
                throw new ArgumentException("Unsupported");
            }
        }