🚨 捕获异常, 取消崩溃通知
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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;
|
||||
@@ -197,8 +200,8 @@ namespace ShowSeconds
|
||||
|
||||
SecondsDataContext dc = this.DataContext as SecondsDataContext;
|
||||
dc.Seconds = (DateTime.Now.Hour).ToString() + ":" +
|
||||
FormatMS(DateTime.Now.Minute) + ":" +
|
||||
FormatMS(DateTime.Now.Second);
|
||||
FormatMS(DateTime.Now.Minute) + ":" +
|
||||
FormatMS(DateTime.Now.Second);
|
||||
|
||||
int sx = (int)(SystemParameters.PrimaryScreenWidth * lProportion);
|
||||
int sMarginBottom = (int)(SystemParameters.WorkArea.Height * tProportion);
|
||||
@@ -209,7 +212,7 @@ namespace ShowSeconds
|
||||
}
|
||||
else
|
||||
{
|
||||
BGBorder.Visibility= Visibility.Collapsed;
|
||||
BGBorder.Visibility = Visibility.Collapsed;
|
||||
timer.Stop();
|
||||
}
|
||||
}
|
||||
@@ -217,22 +220,25 @@ namespace ShowSeconds
|
||||
else if (true)
|
||||
{
|
||||
if ((expandClock && (x < 1574 / w * width
|
||||
|| x > 1906 / w * width
|
||||
|| y < 598 / h * height
|
||||
|| y > 1020 / h * height)
|
||||
)
|
||||
|| !expandClock && (x < 1574 / w * width
|
||||
|| x > 1906 / w * width
|
||||
|| y < 950 / h * height
|
||||
|| y > 1020 / h * height)
|
||||
)
|
||||
|| x > 1906 / w * width
|
||||
|| y < 598 / h * height
|
||||
|| y > 1020 / h * height)
|
||||
)
|
||||
|| !expandClock && (x < 1574 / w * width
|
||||
|| x > 1906 / w * width
|
||||
|| y < 950 / h * height
|
||||
|| y > 1020 / h * height)
|
||||
)
|
||||
{
|
||||
BGBorder.Visibility = Visibility.Collapsed;
|
||||
timer.Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception) { }
|
||||
}));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -34,18 +34,22 @@ namespace GeekDesk.Task
|
||||
{
|
||||
App.Current.Dispatcher.Invoke((Action)(() =>
|
||||
{
|
||||
if (MainWindow.appData.ToDoList.Count > 0)
|
||||
try
|
||||
{
|
||||
string nowTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
ObservableCollection<ToDoInfo> exeBacklogList = MainWindow.appData.ToDoList;
|
||||
foreach (ToDoInfo info in exeBacklogList)
|
||||
if (MainWindow.appData.ToDoList.Count > 0)
|
||||
{
|
||||
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();
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -296,33 +296,38 @@ namespace GeekDesk.Util
|
||||
/// </summary>
|
||||
public static void SortIconList()
|
||||
{
|
||||
if (MainWindow.appData.AppConfig.IconSortType != SortType.CUSTOM)
|
||||
try
|
||||
{
|
||||
ObservableCollection<MenuInfo> menuList = MainWindow.appData.MenuList;
|
||||
//List<IconInfo> list = new List<IconInfo>(menuList[MainWindow.appData.AppConfig.SelectedMenuIndex].IconList);
|
||||
List<IconInfo> list;
|
||||
foreach (MenuInfo menuInfo in menuList)
|
||||
if (MainWindow.appData.AppConfig.IconSortType != SortType.CUSTOM)
|
||||
{
|
||||
list = new List<IconInfo>(menuInfo.IconList);
|
||||
switch (MainWindow.appData.AppConfig.IconSortType)
|
||||
ObservableCollection<MenuInfo> menuList = MainWindow.appData.MenuList;
|
||||
//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.Sort((x, y) => x.Count.CompareTo(y.Count));
|
||||
break;
|
||||
case SortType.COUNT_LOW:
|
||||
list.Sort((x, y) => y.Count.CompareTo(x.Count));
|
||||
break;
|
||||
case SortType.NAME_UP:
|
||||
list.Sort((x, y) => x.Name.CompareTo(y.Name));
|
||||
break;
|
||||
case SortType.NAME_LOW:
|
||||
list.Sort((x, y) => y.Name.CompareTo(x.Name));
|
||||
break;
|
||||
list = new List<IconInfo>(menuInfo.IconList);
|
||||
switch (MainWindow.appData.AppConfig.IconSortType)
|
||||
{
|
||||
case SortType.COUNT_UP:
|
||||
list.Sort((x, y) => x.Count.CompareTo(y.Count));
|
||||
break;
|
||||
case SortType.COUNT_LOW:
|
||||
list.Sort((x, y) => y.Count.CompareTo(x.Count));
|
||||
break;
|
||||
case SortType.NAME_UP:
|
||||
list.Sort((x, y) => x.Name.CompareTo(y.Name));
|
||||
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(() =>
|
||||
{
|
||||
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);
|
||||
FileSystemInfo[] fileInfos = dirInfo.GetFileSystemInfos();
|
||||
if (menuInfo.MenuType == Constant.MenuType.LINK)
|
||||
{
|
||||
DirectoryInfo dirInfo = new DirectoryInfo(menuInfo.LinkPath);
|
||||
FileSystemInfo[] fileInfos = dirInfo.GetFileSystemInfos();
|
||||
|
||||
ObservableCollection<IconInfo> iconList = new ObservableCollection<IconInfo>();
|
||||
foreach (FileSystemInfo fileInfo in fileInfos)
|
||||
{
|
||||
IconInfo iconInfo = CommonCode.GetIconInfoByPath_NoWrite(fileInfo.FullName);
|
||||
iconList.Add(iconInfo);
|
||||
}
|
||||
App.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
foreach (IconInfo iconInfo in iconList)
|
||||
ObservableCollection<IconInfo> iconList = new ObservableCollection<IconInfo>();
|
||||
foreach (FileSystemInfo fileInfo in fileInfos)
|
||||
{
|
||||
menuInfo.IconList = null;
|
||||
menuInfo.IconList = iconList;
|
||||
IconInfo iconInfo = CommonCode.GetIconInfoByPath_NoWrite(fileInfo.FullName);
|
||||
iconList.Add(iconInfo);
|
||||
}
|
||||
});
|
||||
App.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
foreach (IconInfo iconInfo in iconList)
|
||||
{
|
||||
menuInfo.IconList = null;
|
||||
menuInfo.IconList = iconList;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception) { }
|
||||
}).Start();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user