/// ------------------------------------------------------------------------------------------------------------------------ /// <summary> /// Schreibt Änderungen in die Datei /// </summary> public void WriteArrays() { try { List <string> lines = new List <string>(); for (int i = 0; i < TokenIDs.Length; i++) { lines.Add(TokenNames[i]); lines.Add(TokenIDs[i]); } Supporter.ClearGarbageContainer(); File.WriteAllLines(TokenFilePath, lines); } catch (System.Exception e) { DialogResult result = MessageBox.Show(e.Message, "Error while writing!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); if (result == DialogResult.Retry) { Supporter.ClearGarbageContainer(); WriteArrays(); } } // ToDo: GoogleDrive-Upload }
/// <summary> /// Event für den Offline-Modus /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ChoiceButton1_Click(object sender, EventArgs e) { webExceptionDialog.Close(); Settings.Default.SettingUseLocalFile = true; Settings.Default.Save(); Supporter.ClearGarbageContainer(); Application.Restart(); }
/// ------------------------------------------------------------------------------------------------------------------------ /// <summary> /// Schreibt Änderungen in die Datei /// </summary> public void WriteJSONArrays() { try { FillArrays(); string jsonString = JsonConvert.SerializeObject(TokenJSONList); Supporter.ClearGarbageContainer(); File.WriteAllText(TokenFilePath, jsonString); } catch (System.Exception e) { DialogResult result = MessageBox.Show(e.Message, "Error while writing!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); if (result == DialogResult.Retry) { Supporter.ClearGarbageContainer(); WriteArrays(); } } // ToDo: GoogleDrive-Upload }