public PhoneDeviceInfo(string backupPath, string displayName, DateTime?lastSync, IOsVersion osVersion, Guid?deviceGuid) { BackupPath = backupPath; DisplayName = displayName; LastSync = lastSync; OsVersion = osVersion; DeviceGuid = deviceGuid; }
public PhoneDeviceInfo(string backupPath, string displayName, DateTime? lastSync, IOsVersion osVersion, Guid? deviceGuid) { BackupPath = backupPath; DisplayName = displayName; LastSync = lastSync; OsVersion = osVersion; DeviceGuid = deviceGuid; }
private static IPhoneDeviceInfo PhoneDeviceInfoFromXmlReader(string backupPath, XmlReader infoXmlReader) { string displayName = null; DateTime? lastBackupDate = null; IOsVersion osVersion = null; Guid? deviceGuid = null; try { infoXmlReader.ReadToDescendant("dict"); if (!infoXmlReader.IsStartElement()) { throw new InvalidDataException("Value dictionary not found."); } infoXmlReader.ReadToDescendant("key"); while (!infoXmlReader.EOF) { try { string keyName = infoXmlReader.ReadString(); switch (keyName) { case "Display Name": displayName = ReadNextStringNode(infoXmlReader); break; case "Last Backup Date": lastBackupDate = ReadNextDateNode(infoXmlReader); break; case "Product Version": string versionString = ReadNextStringNode(infoXmlReader); osVersion = new OsVersion(versionString); break; case "GUID": deviceGuid = new Guid(ReadNextStringNode(infoXmlReader)); break; default: break; } infoXmlReader.ReadToNextSibling("key"); } catch (XmlException) { throw; } catch (Exception) { ; } } } catch (Exception) { ; } return(new PhoneDeviceInfo(backupPath, displayName, lastBackupDate, osVersion, deviceGuid)); }