代码优化
This commit is contained in:
@@ -124,7 +124,7 @@ namespace Ink_Canvas.Windows
|
||||
CheckBoxHideStrokeWhenSelecting.IsChecked = _settings.Canvas.HideStrokeWhenSelecting;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
|
||||
|
||||
// 手势操作
|
||||
try
|
||||
@@ -137,7 +137,7 @@ namespace Ink_Canvas.Windows
|
||||
CheckBoxEnablePalmEraser.IsChecked = _settings.Canvas != null && _settings.Canvas.EnablePalmEraser;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
|
||||
|
||||
// 墨迹纠正
|
||||
try
|
||||
@@ -147,7 +147,7 @@ namespace Ink_Canvas.Windows
|
||||
CheckBoxInkToShapeEnabled.IsChecked = _settings.InkToShape.IsInkToShapeEnabled;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
|
||||
|
||||
// 快捷键(外观)
|
||||
try
|
||||
@@ -157,7 +157,7 @@ namespace Ink_Canvas.Windows
|
||||
CheckBoxEnableHotkeysInMouseMode.IsChecked = _settings.Appearance.EnableHotkeysInMouseMode;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
|
||||
|
||||
// 崩溃处理
|
||||
try
|
||||
@@ -165,7 +165,7 @@ namespace Ink_Canvas.Windows
|
||||
RadioCrashSilentRestart.IsChecked = _settings.Startup.CrashAction == 0;
|
||||
RadioCrashNoAction.IsChecked = _settings.Startup.CrashAction != 0;
|
||||
}
|
||||
catch { }
|
||||
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
|
||||
|
||||
// 自动化行为
|
||||
try
|
||||
@@ -180,7 +180,7 @@ namespace Ink_Canvas.Windows
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
|
||||
|
||||
// 随机点名
|
||||
try
|
||||
@@ -190,7 +190,7 @@ namespace Ink_Canvas.Windows
|
||||
CheckBoxShowRandomAndSingleDraw.IsChecked = _settings.RandSettings.ShowRandomAndSingleDraw;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
|
||||
|
||||
// 高级选项
|
||||
try
|
||||
@@ -200,7 +200,7 @@ namespace Ink_Canvas.Windows
|
||||
CheckBoxIsLogEnabled.IsChecked = _settings.Advanced.IsLogEnabled;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
|
||||
|
||||
// 截图(自动化中的截图相关)
|
||||
try
|
||||
@@ -211,7 +211,7 @@ namespace Ink_Canvas.Windows
|
||||
CheckBoxSaveScreenshotsInDateFolders.IsChecked = _settings.Automation.IsSaveScreenshotsInDateFolders;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
|
||||
}
|
||||
|
||||
private void ApplySelection()
|
||||
@@ -312,7 +312,7 @@ namespace Ink_Canvas.Windows
|
||||
_settings.Canvas.EnablePalmEraser = CheckBoxEnablePalmEraser.IsChecked == true;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
|
||||
|
||||
// 写回手势操作
|
||||
try
|
||||
@@ -324,7 +324,7 @@ namespace Ink_Canvas.Windows
|
||||
_settings.Gesture.AutoSwitchTwoFingerGesture = CheckBoxAutoSwitchTwoFingerGesture.IsChecked == true;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
|
||||
|
||||
// 写回墨迹纠正
|
||||
try
|
||||
@@ -334,7 +334,7 @@ namespace Ink_Canvas.Windows
|
||||
_settings.InkToShape.IsInkToShapeEnabled = CheckBoxInkToShapeEnabled.IsChecked == true;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
|
||||
|
||||
// 写回快捷键(外观)
|
||||
try
|
||||
@@ -344,14 +344,14 @@ namespace Ink_Canvas.Windows
|
||||
_settings.Appearance.EnableHotkeysInMouseMode = CheckBoxEnableHotkeysInMouseMode.IsChecked == true;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
|
||||
|
||||
// 写回崩溃处理(0=静默重启,1=无操作)
|
||||
try
|
||||
{
|
||||
_settings.Startup.CrashAction = RadioCrashNoAction.IsChecked == true ? 1 : 0;
|
||||
}
|
||||
catch { }
|
||||
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
|
||||
|
||||
// 写回自动化行为
|
||||
try
|
||||
@@ -368,7 +368,7 @@ namespace Ink_Canvas.Windows
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
|
||||
|
||||
// 写回随机点名
|
||||
try
|
||||
@@ -378,7 +378,7 @@ namespace Ink_Canvas.Windows
|
||||
_settings.RandSettings.ShowRandomAndSingleDraw = CheckBoxShowRandomAndSingleDraw.IsChecked == true;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
|
||||
|
||||
// 写回高级选项
|
||||
try
|
||||
@@ -388,7 +388,7 @@ namespace Ink_Canvas.Windows
|
||||
_settings.Advanced.IsLogEnabled = CheckBoxIsLogEnabled.IsChecked == true;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
|
||||
|
||||
// 标记用户已经阅读并确认过隐私说明
|
||||
_settings.Startup.HasAcceptedTelemetryPrivacy = true;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Ink_Canvas.Helpers;
|
||||
using Ink_Canvas.Helpers;
|
||||
using iNKORE.UI.WPF.Modern;
|
||||
using System;
|
||||
using System.Windows;
|
||||
@@ -89,7 +89,7 @@ namespace Ink_Canvas
|
||||
if (themeKey != null) keyValue = (int)themeKey.GetValue("SystemUsesLightTheme");
|
||||
if (keyValue == 1) light = true;
|
||||
}
|
||||
catch { }
|
||||
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
|
||||
|
||||
return light;
|
||||
}
|
||||
|
||||
@@ -1399,7 +1399,7 @@ namespace Ink_Canvas.Windows
|
||||
System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance);
|
||||
presentation = currentPresentationProperty?.GetValue(pptManager) as Microsoft.Office.Interop.PowerPoint.Presentation;
|
||||
}
|
||||
catch { }
|
||||
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
|
||||
|
||||
// 如果 CurrentPresentation 不可用,尝试 GetCurrentActivePresentation
|
||||
if (presentation == null)
|
||||
@@ -1409,7 +1409,7 @@ namespace Ink_Canvas.Windows
|
||||
var getCurrentActivePresentationMethod = pptManager.GetType().GetMethod("GetCurrentActivePresentation");
|
||||
presentation = getCurrentActivePresentationMethod?.Invoke(pptManager, null) as Microsoft.Office.Interop.PowerPoint.Presentation;
|
||||
}
|
||||
catch { }
|
||||
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
|
||||
}
|
||||
|
||||
if (presentation != null)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Ink_Canvas.Helpers;
|
||||
using Ink_Canvas.Helpers;
|
||||
using iNKORE.UI.WPF.Modern.Controls;
|
||||
using Microsoft.VisualBasic;
|
||||
using System;
|
||||
@@ -131,7 +131,7 @@ namespace Ink_Canvas
|
||||
if (themeKey != null) keyValue = (int)themeKey.GetValue("SystemUsesLightTheme");
|
||||
if (keyValue == 1) light = true;
|
||||
}
|
||||
catch { }
|
||||
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
|
||||
|
||||
return light;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using iNKORE.UI.WPF.Helpers;
|
||||
using iNKORE.UI.WPF.Helpers;
|
||||
using Ink_Canvas.Helpers;
|
||||
using OSVersionExtension;
|
||||
using System;
|
||||
@@ -38,7 +38,7 @@ namespace Ink_Canvas.Windows.SettingsViews
|
||||
CopyrightBannerImage.Source =
|
||||
new BitmapImage(new Uri($"file://{App.RootPath + "icc-about-illustrations.png"}"));
|
||||
}
|
||||
catch { }
|
||||
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -173,7 +173,7 @@ namespace Ink_Canvas.Windows.SettingsViews
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
|
||||
}
|
||||
|
||||
public static class TouchTabletDetectHelper
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace Ink_Canvas.Windows.SettingsViews
|
||||
ThemeHelper.ApplyThemeToControl(this);
|
||||
LoadSettings();
|
||||
}
|
||||
catch { }
|
||||
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user