fix manual window failing if opened twice thanks to CMDR NeedX
This commit is contained in:
parent
1aeb5a09e0
commit
d087c1862a
@ -29,7 +29,7 @@ namespace EliteBGS {
|
||||
|
||||
public Report Report => report;
|
||||
|
||||
private LoadEntriesWindow loadentries = new LoadEntriesWindow();
|
||||
private LoadEntriesWindow loadentries = null;
|
||||
|
||||
private static readonly List<DiscordLogGenerator> logtypes = new List<DiscordLogGenerator>() {
|
||||
new NonaDiscordLog(),
|
||||
@ -45,8 +45,6 @@ namespace EliteBGS {
|
||||
/* ignored */
|
||||
}
|
||||
|
||||
loadentries.EntriesLoaded += Loadentries_EntriesLoaded;
|
||||
|
||||
report.OnLog += Report_OnLog;
|
||||
|
||||
foreach (DiscordLogGenerator type in logtypes) {
|
||||
@ -338,11 +336,24 @@ namespace EliteBGS {
|
||||
}
|
||||
|
||||
private void ManuallyParse_Click(object sender, RoutedEventArgs e) {
|
||||
if (loadentries != null) {
|
||||
loadentries.Show();
|
||||
return;
|
||||
}
|
||||
|
||||
loadentries = new LoadEntriesWindow();
|
||||
loadentries.Closed += Loadentries_Closed;
|
||||
loadentries.EntriesLoaded += Loadentries_EntriesLoaded;
|
||||
loadentries.Show();
|
||||
}
|
||||
|
||||
private void Loadentries_Closed(object sender, EventArgs e) {
|
||||
loadentries = null;
|
||||
}
|
||||
|
||||
private void window_Closing(object sender, System.ComponentModel.CancelEventArgs e) {
|
||||
loadentries.Close();
|
||||
loadentries?.Close();
|
||||
loadentries = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user