[chore:] logging for EditorWindow.axaml.cs
This commit is contained in:
+18
-13
@@ -11,19 +11,23 @@ public partial class EditorWindow : Window
|
||||
|
||||
public EditorWindow(string filename = "")
|
||||
{
|
||||
InitializeComponent();
|
||||
this.filename = filename;
|
||||
if (!string.IsNullOrWhiteSpace(filename) && File.Exists(filename))
|
||||
try
|
||||
{
|
||||
var content = TbContent;
|
||||
if (content != null) content.Text = File.ReadAllText(this.filename);
|
||||
Title = "Wiki Editor - " + filename;
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(filename))
|
||||
{
|
||||
MessageBox.Show(null, "Die Datei existiert nicht", "Fehler");
|
||||
Close();
|
||||
}
|
||||
InitializeComponent();
|
||||
this.filename = filename;
|
||||
if (!string.IsNullOrWhiteSpace(filename) && File.Exists(filename))
|
||||
{
|
||||
var content = TbContent;
|
||||
if (content != null) content.Text = File.ReadAllText(this.filename);
|
||||
Title = "Wiki Editor - " + filename;
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(filename))
|
||||
{
|
||||
MessageBox.Show(null, "Die Datei existiert nicht", "Fehler");
|
||||
Close();
|
||||
}
|
||||
} catch (Exception ex) { Logger.Log($"Error while : {ex.Message}",Logger.LogType.Error);}
|
||||
|
||||
}
|
||||
|
||||
private void BtnSave_OnClick(object? sender, RoutedEventArgs e)
|
||||
@@ -38,6 +42,7 @@ public partial class EditorWindow : Window
|
||||
MessageBox.Show(null,
|
||||
"Es ist ein Fehler aufgetreten. Bitte senden Sie ihn über git.mypapercloud.de/fierke/logofclient ein:\n" +
|
||||
ex.StackTrace, "Fehler");
|
||||
Logger.Log($"Error while : {ex.Message}",Logger.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +60,7 @@ public partial class EditorWindow : Window
|
||||
try
|
||||
{
|
||||
File.Delete(filename);
|
||||
} catch {}
|
||||
} catch (Exception ex) { Logger.Log($"Error while : {ex.Message}",Logger.LogType.Error);}
|
||||
|
||||
MainWindow._instance.PopulateNavTree();
|
||||
Close();
|
||||
|
||||
Reference in New Issue
Block a user