Skip to content

Commit 7a71e96

Browse files
authored
Merge pull request #12 from dimojang/crash_handling
bugs fixed
2 parents d2586dd + 84c1068 commit 7a71e96

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

App.xaml.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,18 +107,20 @@ private void CurrentDomain_ProcessExit(object sender, EventArgs e)
107107

108108
void Current_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
109109
{
110-
MessageBox.Show(LanguageHelper.InquireLocalizedWord("System_ExcptionInfo") + e.Exception.Message,
110+
MessageBox.Show(LanguageHelper.InquireLocalizedWord("System_ExcptionInfo") + e.Exception.Message + sender.ToString(),
111111
LanguageHelper.InquireLocalizedWord("TaskBar_AppName"),
112112
MessageBoxButton.OK,
113113
MessageBoxImage.Error);
114114
}
115115

116116
void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
117117
{
118-
MessageBox.Show(LanguageHelper.InquireLocalizedWord("System_ExcptionInfo") + e.ToString(),
118+
MessageBox.Show(LanguageHelper.InquireLocalizedWord("System_ExcptionInfo") + e.ToString() + sender.ToString(),
119119
LanguageHelper.InquireLocalizedWord("TaskBar_AppName"),
120120
MessageBoxButton.OK,
121121
MessageBoxImage.Error);
122+
123+
Environment.Exit(1);
122124
}
123125

124126
private void SystemEvents_SessionEnded(object sender, SessionEndedEventArgs e)

Classes/MyDay.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class MyDay
3232
/// <returns>今日小结 - Dictionary<string, TimeSpan></returns>
3333
public Dictionary<string, Software> GetOverView()
3434
{
35-
List<MyTimeDuration> myTimeDurations = TimeLine;
35+
List<MyTimeDuration> myTimeDurations = new List<MyTimeDuration>(TimeLine.ToArray());
3636
Dictionary<string, Software> overView = new Dictionary<string, Software>();
3737

3838
foreach (MyTimeDuration item in myTimeDurations)

0 commit comments

Comments
 (0)