Skip to content

Commit

Permalink
Bugfix: Gruppennamen mit speziellen Zeichen
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximilianJ committed May 24, 2024
1 parent e5724a4 commit 960ce96
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion BWB-Auswertung/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using System.Text.Json;
using System.Net.Http;
using ControlzEx.Standard;
using System.Text.RegularExpressions;

namespace BWB_Auswertung
{
Expand Down Expand Up @@ -427,9 +428,12 @@ private void SaveData(string savePath, bool deleteOld = false)
{
List<string> aktuelleDateien = new List<string>();
MainViewModel viewModel = (MainViewModel)this.DataContext;

Regex rgx = new Regex("[^a-zA-Z0-9öäüÄÜÖß ]");

foreach (var gruppe in viewModel.Gruppen)
{
string datei = System.IO.Path.Combine($"{gruppe.Feuerwehr} - {gruppe.GruppenName}.xml");
string datei = System.IO.Path.Combine($"{rgx.Replace(gruppe.Feuerwehr, "")} - {rgx.Replace(gruppe.GruppenName, "")}.xml");
WriteFile.writeText(System.IO.Path.Combine(savePath, datei), SerializeXML<Gruppe>.Serialize(gruppe));

//Dateinamen merken um alte löschen zu können
Expand Down

0 comments on commit 960ce96

Please sign in to comment.