public LoginData ReadDataLogin() { if (ReadWriteData.Exists(ReadWriteData.File_Login)) { TextReader reader = ReadWriteData.Read(ReadWriteData.File_Login); LoginData data = JsonConvert.DeserializeObject <LoginData>(reader.ReadToEnd()); reader.Close(); return(data); } return(null); }
public void ReadSettings() { xmlSettings = new XmlDocument(); if (ReadWriteData.Exists(ReadWriteData.File_Settings)) { xmlSettings.Load(ReadWriteData.Read(ReadWriteData.File_Settings)); } else { xmlSettings.LoadXml(global::Core.Properties.Resources.SettingDefault); SaveSettings(); } }
public void ReadData() { if (ReadWriteData.Exists(ReadWriteData.File_DataUploadDownload)) { var readerjson = ReadWriteData.Read(ReadWriteData.File_DataUploadDownload); if (readerjson != null) { List <JsonDataSaveGroup> json_groups = JsonConvert.DeserializeObject <List <JsonDataSaveGroup> >(readerjson.ReadToEnd()); foreach (JsonDataSaveGroup json_group in json_groups) { ItemsTransferManager group = new ItemsTransferManager(json_group); this.GroupsWork.Add(group); } } } }
public void ReadData() { if (ReadWriteData.Exists(ReadWriteData.File_DataUploadDownload)) { var readerjson = ReadWriteData.Read(ReadWriteData.File_DataUploadDownload); if (readerjson != null) { try { this.ItemsTransfer = JsonConvert.DeserializeObject <TransferListViewData>(readerjson.ReadToEnd()); } catch (Exception) { readerjson.Close(); ReadWriteData.Delete(ReadWriteData.File_DataUploadDownload); } } } }