🚨 捕获异常, 取消崩溃通知

This commit is contained in:
BookerLiu
2023-04-23 21:42:55 +08:00
parent ac8302280f
commit 1d6830b30b
6 changed files with 77 additions and 58 deletions

View File

@@ -54,7 +54,7 @@ namespace GeekDesk
void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
LogUtil.WriteErrorLog(e, "严重异常!");
MessageBox.Show("GeekDesk遇到未知问题崩溃!");
//MessageBox.Show("GeekDesk遇到未知问题崩溃!");
}
public static void DoEvents()
{

View File

@@ -164,7 +164,7 @@
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="LeftColumn" MinWidth="80" Width="{Binding AppConfig.MenuCardWidth, Mode=TwoWay, Converter={StaticResource DoubleToGridLength}}" MaxWidth="200"></ColumnDefinition>
<ColumnDefinition x:Name="LeftColumn" MinWidth="80" Width="{Binding AppConfig.MenuCardWidth, Mode=TwoWay, Converter={StaticResource DoubleToGridLength}}" MaxWidth="280"></ColumnDefinition>
<ColumnDefinition x:Name="RightColumn" Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
@@ -233,7 +233,7 @@
<uc:LeftCardControl x:Name="LeftCard" Grid.Row="1" Grid.Column="0"/>
<!--分割线-->
<GridSplitter Opacity="0" Grid.Row="1" Grid.Column="0" Width="1" VerticalAlignment="Stretch" HorizontalAlignment="Right"/>
<GridSplitter Opacity="0" Grid.Row="1" Grid.Column="0" Width="5" VerticalAlignment="Stretch" HorizontalAlignment="Right"/>
<Border x:Name="SearchResContainer" Panel.ZIndex="2"
Visibility="Collapsed"

View File

@@ -124,11 +124,14 @@ namespace ShowSeconds
private void SecondsHookSetFuc(object sender, MouseEventExtArgs e)
{
if (e.Button == System.Windows.Forms.MouseButtons.Left)
{
if (ScreenUtil.IsPrimaryFullScreen()) return;
App.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Render, new Action(() =>
{
try
{
int x = e.X;
int y = e.Y;
@@ -209,7 +212,7 @@ namespace ShowSeconds
}
else
{
BGBorder.Visibility= Visibility.Collapsed;
BGBorder.Visibility = Visibility.Collapsed;
timer.Stop();
}
}
@@ -231,8 +234,11 @@ namespace ShowSeconds
timer.Stop();
}
}
}
catch (Exception) { }
}));
}
}

View File

@@ -33,6 +33,8 @@ namespace GeekDesk.Task
private static void Check(object source, ElapsedEventArgs e)
{
App.Current.Dispatcher.Invoke((Action)(() =>
{
try
{
if (MainWindow.appData.ToDoList.Count > 0)
{
@@ -46,6 +48,8 @@ namespace GeekDesk.Task
}
}
}
}
catch (Exception) { }
//ClearMemory();
}));
}

View File

@@ -295,6 +295,8 @@ namespace GeekDesk.Util
/// 排序图标
/// </summary>
public static void SortIconList()
{
try
{
if (MainWindow.appData.AppConfig.IconSortType != SortType.CUSTOM)
{
@@ -324,6 +326,9 @@ namespace GeekDesk.Util
MainWindow.appData.AppConfig.SelectedMenuIcons = MainWindow.appData.MenuList[MainWindow.appData.AppConfig.SelectedMenuIndex].IconList;
}
}
catch (Exception) { }
}

View File

@@ -104,6 +104,8 @@ namespace GeekDesk.Util
private static void RefreshLinkMenuIcon(AppData appData)
{
new Thread(() =>
{
try
{
foreach (MenuInfo menuInfo in appData.MenuList)
{
@@ -128,6 +130,8 @@ namespace GeekDesk.Util
});
}
}
}
catch (Exception) { }
}).Start();
}