🚨 捕获异常, 取消崩溃通知
This commit is contained in:
@@ -54,7 +54,7 @@ namespace GeekDesk
|
|||||||
void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
|
void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
|
||||||
{
|
{
|
||||||
LogUtil.WriteErrorLog(e, "严重异常!");
|
LogUtil.WriteErrorLog(e, "严重异常!");
|
||||||
MessageBox.Show("GeekDesk遇到未知问题崩溃!");
|
//MessageBox.Show("GeekDesk遇到未知问题崩溃!");
|
||||||
}
|
}
|
||||||
public static void DoEvents()
|
public static void DoEvents()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -164,7 +164,7 @@
|
|||||||
<RowDefinition Height="*"></RowDefinition>
|
<RowDefinition Height="*"></RowDefinition>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<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>
|
<ColumnDefinition x:Name="RightColumn" Width="*"></ColumnDefinition>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
@@ -233,7 +233,7 @@
|
|||||||
<uc:LeftCardControl x:Name="LeftCard" Grid.Row="1" Grid.Column="0"/>
|
<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"
|
<Border x:Name="SearchResContainer" Panel.ZIndex="2"
|
||||||
Visibility="Collapsed"
|
Visibility="Collapsed"
|
||||||
|
|||||||
@@ -124,11 +124,14 @@ namespace ShowSeconds
|
|||||||
|
|
||||||
private void SecondsHookSetFuc(object sender, MouseEventExtArgs e)
|
private void SecondsHookSetFuc(object sender, MouseEventExtArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (e.Button == System.Windows.Forms.MouseButtons.Left)
|
if (e.Button == System.Windows.Forms.MouseButtons.Left)
|
||||||
{
|
{
|
||||||
if (ScreenUtil.IsPrimaryFullScreen()) return;
|
if (ScreenUtil.IsPrimaryFullScreen()) return;
|
||||||
|
|
||||||
App.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Render, new Action(() =>
|
App.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Render, new Action(() =>
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
int x = e.X;
|
int x = e.X;
|
||||||
int y = e.Y;
|
int y = e.Y;
|
||||||
@@ -197,8 +200,8 @@ namespace ShowSeconds
|
|||||||
|
|
||||||
SecondsDataContext dc = this.DataContext as SecondsDataContext;
|
SecondsDataContext dc = this.DataContext as SecondsDataContext;
|
||||||
dc.Seconds = (DateTime.Now.Hour).ToString() + ":" +
|
dc.Seconds = (DateTime.Now.Hour).ToString() + ":" +
|
||||||
FormatMS(DateTime.Now.Minute) + ":" +
|
FormatMS(DateTime.Now.Minute) + ":" +
|
||||||
FormatMS(DateTime.Now.Second);
|
FormatMS(DateTime.Now.Second);
|
||||||
|
|
||||||
int sx = (int)(SystemParameters.PrimaryScreenWidth * lProportion);
|
int sx = (int)(SystemParameters.PrimaryScreenWidth * lProportion);
|
||||||
int sMarginBottom = (int)(SystemParameters.WorkArea.Height * tProportion);
|
int sMarginBottom = (int)(SystemParameters.WorkArea.Height * tProportion);
|
||||||
@@ -209,7 +212,7 @@ namespace ShowSeconds
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BGBorder.Visibility= Visibility.Collapsed;
|
BGBorder.Visibility = Visibility.Collapsed;
|
||||||
timer.Stop();
|
timer.Stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -217,22 +220,25 @@ namespace ShowSeconds
|
|||||||
else if (true)
|
else if (true)
|
||||||
{
|
{
|
||||||
if ((expandClock && (x < 1574 / w * width
|
if ((expandClock && (x < 1574 / w * width
|
||||||
|| x > 1906 / w * width
|
|| x > 1906 / w * width
|
||||||
|| y < 598 / h * height
|
|| y < 598 / h * height
|
||||||
|| y > 1020 / h * height)
|
|| y > 1020 / h * height)
|
||||||
)
|
)
|
||||||
|| !expandClock && (x < 1574 / w * width
|
|| !expandClock && (x < 1574 / w * width
|
||||||
|| x > 1906 / w * width
|
|| x > 1906 / w * width
|
||||||
|| y < 950 / h * height
|
|| y < 950 / h * height
|
||||||
|| y > 1020 / h * height)
|
|| y > 1020 / h * height)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
BGBorder.Visibility = Visibility.Collapsed;
|
BGBorder.Visibility = Visibility.Collapsed;
|
||||||
timer.Stop();
|
timer.Stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch (Exception) { }
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -34,18 +34,22 @@ namespace GeekDesk.Task
|
|||||||
{
|
{
|
||||||
App.Current.Dispatcher.Invoke((Action)(() =>
|
App.Current.Dispatcher.Invoke((Action)(() =>
|
||||||
{
|
{
|
||||||
if (MainWindow.appData.ToDoList.Count > 0)
|
try
|
||||||
{
|
{
|
||||||
string nowTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
if (MainWindow.appData.ToDoList.Count > 0)
|
||||||
ObservableCollection<ToDoInfo> exeBacklogList = MainWindow.appData.ToDoList;
|
|
||||||
foreach (ToDoInfo info in exeBacklogList)
|
|
||||||
{
|
{
|
||||||
if (info.ExeTime.CompareTo(nowTime) == -1 && !activityBacklog.ContainsKey(info))
|
string nowTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
|
ObservableCollection<ToDoInfo> exeBacklogList = MainWindow.appData.ToDoList;
|
||||||
|
foreach (ToDoInfo info in exeBacklogList)
|
||||||
{
|
{
|
||||||
activityBacklog.Add(info, Notification.Show(new BacklogNotificatin(info), ShowAnimation.Fade, true));
|
if (info.ExeTime.CompareTo(nowTime) == -1 && !activityBacklog.ContainsKey(info))
|
||||||
|
{
|
||||||
|
activityBacklog.Add(info, Notification.Show(new BacklogNotificatin(info), ShowAnimation.Fade, true));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception) { }
|
||||||
//ClearMemory();
|
//ClearMemory();
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -296,33 +296,38 @@ namespace GeekDesk.Util
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static void SortIconList()
|
public static void SortIconList()
|
||||||
{
|
{
|
||||||
if (MainWindow.appData.AppConfig.IconSortType != SortType.CUSTOM)
|
try
|
||||||
{
|
{
|
||||||
ObservableCollection<MenuInfo> menuList = MainWindow.appData.MenuList;
|
if (MainWindow.appData.AppConfig.IconSortType != SortType.CUSTOM)
|
||||||
//List<IconInfo> list = new List<IconInfo>(menuList[MainWindow.appData.AppConfig.SelectedMenuIndex].IconList);
|
|
||||||
List<IconInfo> list;
|
|
||||||
foreach (MenuInfo menuInfo in menuList)
|
|
||||||
{
|
{
|
||||||
list = new List<IconInfo>(menuInfo.IconList);
|
ObservableCollection<MenuInfo> menuList = MainWindow.appData.MenuList;
|
||||||
switch (MainWindow.appData.AppConfig.IconSortType)
|
//List<IconInfo> list = new List<IconInfo>(menuList[MainWindow.appData.AppConfig.SelectedMenuIndex].IconList);
|
||||||
|
List<IconInfo> list;
|
||||||
|
foreach (MenuInfo menuInfo in menuList)
|
||||||
{
|
{
|
||||||
case SortType.COUNT_UP:
|
list = new List<IconInfo>(menuInfo.IconList);
|
||||||
list.Sort((x, y) => x.Count.CompareTo(y.Count));
|
switch (MainWindow.appData.AppConfig.IconSortType)
|
||||||
break;
|
{
|
||||||
case SortType.COUNT_LOW:
|
case SortType.COUNT_UP:
|
||||||
list.Sort((x, y) => y.Count.CompareTo(x.Count));
|
list.Sort((x, y) => x.Count.CompareTo(y.Count));
|
||||||
break;
|
break;
|
||||||
case SortType.NAME_UP:
|
case SortType.COUNT_LOW:
|
||||||
list.Sort((x, y) => x.Name.CompareTo(y.Name));
|
list.Sort((x, y) => y.Count.CompareTo(x.Count));
|
||||||
break;
|
break;
|
||||||
case SortType.NAME_LOW:
|
case SortType.NAME_UP:
|
||||||
list.Sort((x, y) => y.Name.CompareTo(x.Name));
|
list.Sort((x, y) => x.Name.CompareTo(y.Name));
|
||||||
break;
|
break;
|
||||||
|
case SortType.NAME_LOW:
|
||||||
|
list.Sort((x, y) => y.Name.CompareTo(x.Name));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
menuInfo.IconList = new ObservableCollection<IconInfo>(list);
|
||||||
}
|
}
|
||||||
menuInfo.IconList = new ObservableCollection<IconInfo>(list);
|
MainWindow.appData.AppConfig.SelectedMenuIcons = MainWindow.appData.MenuList[MainWindow.appData.AppConfig.SelectedMenuIndex].IconList;
|
||||||
}
|
}
|
||||||
MainWindow.appData.AppConfig.SelectedMenuIcons = MainWindow.appData.MenuList[MainWindow.appData.AppConfig.SelectedMenuIndex].IconList;
|
|
||||||
}
|
}
|
||||||
|
catch (Exception) { }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -105,29 +105,33 @@ namespace GeekDesk.Util
|
|||||||
{
|
{
|
||||||
new Thread(() =>
|
new Thread(() =>
|
||||||
{
|
{
|
||||||
foreach (MenuInfo menuInfo in appData.MenuList)
|
try
|
||||||
{
|
{
|
||||||
if (menuInfo.MenuType == Constant.MenuType.LINK)
|
foreach (MenuInfo menuInfo in appData.MenuList)
|
||||||
{
|
{
|
||||||
DirectoryInfo dirInfo = new DirectoryInfo(menuInfo.LinkPath);
|
if (menuInfo.MenuType == Constant.MenuType.LINK)
|
||||||
FileSystemInfo[] fileInfos = dirInfo.GetFileSystemInfos();
|
{
|
||||||
|
DirectoryInfo dirInfo = new DirectoryInfo(menuInfo.LinkPath);
|
||||||
|
FileSystemInfo[] fileInfos = dirInfo.GetFileSystemInfos();
|
||||||
|
|
||||||
ObservableCollection<IconInfo> iconList = new ObservableCollection<IconInfo>();
|
ObservableCollection<IconInfo> iconList = new ObservableCollection<IconInfo>();
|
||||||
foreach (FileSystemInfo fileInfo in fileInfos)
|
foreach (FileSystemInfo fileInfo in fileInfos)
|
||||||
{
|
|
||||||
IconInfo iconInfo = CommonCode.GetIconInfoByPath_NoWrite(fileInfo.FullName);
|
|
||||||
iconList.Add(iconInfo);
|
|
||||||
}
|
|
||||||
App.Current.Dispatcher.Invoke(() =>
|
|
||||||
{
|
|
||||||
foreach (IconInfo iconInfo in iconList)
|
|
||||||
{
|
{
|
||||||
menuInfo.IconList = null;
|
IconInfo iconInfo = CommonCode.GetIconInfoByPath_NoWrite(fileInfo.FullName);
|
||||||
menuInfo.IconList = iconList;
|
iconList.Add(iconInfo);
|
||||||
}
|
}
|
||||||
});
|
App.Current.Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
foreach (IconInfo iconInfo in iconList)
|
||||||
|
{
|
||||||
|
menuInfo.IconList = null;
|
||||||
|
menuInfo.IconList = iconList;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception) { }
|
||||||
}).Start();
|
}).Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user