Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 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();
     }
 }
Esempio n. 3
0
 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);
             }
         }
     }
 }
Esempio n. 4
0
 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);
             }
         }
     }
 }