This commit is contained in:
PrefacedCorg
2026-03-21 16:19:38 +08:00
5 changed files with 20 additions and 25 deletions
+7 -7
View File
@@ -1,8 +1,10 @@
using Hardcodet.Wpf.TaskbarNotification;
using Ink_Canvas.Helpers;
using Ink_Canvas.Properties;
using iNKORE.UI.WPF.Modern.Controls;
using Microsoft.Win32;
using Newtonsoft.Json;
using Sentry;
using System;
using System.Diagnostics;
using System.IO;
@@ -18,10 +20,8 @@ using System.Windows.Input;
using System.Windows.Threading;
using Application = System.Windows.Application;
using MessageBox = System.Windows.MessageBox;
using Ink_Canvas.Properties;
using SplashScreen = Ink_Canvas.Windows.SplashScreen;
using Timer = System.Threading.Timer;
using Sentry;
namespace Ink_Canvas
{
@@ -1088,7 +1088,7 @@ namespace Ink_Canvas
LogHelper.WriteLogToFile($"启动完成心跳已记录");
}
LogHelper.WriteLogToFile($"启动时长: {(startupCompleteHeartbeat - appStartupStartTime).TotalSeconds:F2}秒");
if (_isSplashScreenShown)
{
SetSplashMessage("完成初始化...");
@@ -1223,8 +1223,8 @@ namespace Ink_Canvas
if (!isStartupComplete && appStartupStartTime != DateTime.MinValue)
{
DateTime startTime = _isSplashScreenShown && splashScreenStartTime != DateTime.MinValue
? splashScreenStartTime
DateTime startTime = _isSplashScreenShown && splashScreenStartTime != DateTime.MinValue
? splashScreenStartTime
: appStartupStartTime;
TimeSpan elapsedSinceStart = DateTime.Now - startTime;
if (elapsedSinceStart.TotalMinutes >= 2)
@@ -1405,7 +1405,7 @@ namespace Ink_Canvas
string assemblyLocation = Assembly.GetExecutingAssembly().Location;
string currentDir = Path.GetDirectoryName(assemblyLocation);
for (int i = 0; i < 5; i++)
{
string dsnFilePath = Path.Combine(currentDir, "telemetry_dsn.txt");
@@ -1417,7 +1417,7 @@ namespace Ink_Canvas
return dsn;
}
}
DirectoryInfo parentDir = Directory.GetParent(currentDir);
if (parentDir == null)
{
+1 -3
View File
@@ -264,7 +264,6 @@ namespace Ink_Canvas.Helpers
public void Enable()
{
IsEnabled = true;
LogHelper.WriteLogToFile("墨迹渐隐功能已启用");
}
/// <summary>
@@ -273,7 +272,6 @@ namespace Ink_Canvas.Helpers
public void Disable()
{
IsEnabled = false;
LogHelper.WriteLogToFile("墨迹渐隐功能已禁用");
}
#endregion
@@ -894,4 +892,4 @@ namespace Ink_Canvas.Helpers
}
#endregion
}
}
}
+10 -10
View File
@@ -150,13 +150,13 @@ namespace Ink_Canvas.Helpers
private void CheckAndConnectToPPT()
{
if (_isModuleUnloading) return;
lock (_lockObject)
{
try
{
if (_isModuleUnloading) return;
// 尝试连接到PowerPoint
var pptApp = TryConnectToPowerPoint();
if (pptApp == null && IsSupportWPS)
@@ -421,7 +421,7 @@ namespace Ink_Canvas.Helpers
SafeReleaseComObject(CurrentSlide, "CurrentSlide");
SafeReleaseComObject(CurrentSlides, "CurrentSlides");
SafeReleaseComObject(CurrentPresentation, "CurrentPresentation");
if (PPTApplication != null && Marshal.IsComObject(PPTApplication))
{
try
@@ -474,13 +474,13 @@ namespace Ink_Canvas.Helpers
_isModuleUnloading = false;
return;
}
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
Thread.Sleep(1000);
_isModuleUnloading = false;
try
@@ -494,7 +494,7 @@ namespace Ink_Canvas.Helpers
{
LogHelper.WriteLogToFile("PPT联动模块重载时计时器已释放,跳过重启", LogHelper.LogType.Trace);
}
LogHelper.WriteLogToFile("PPT联动模块已重新加载", LogHelper.LogType.Trace);
}
catch (Exception ex)
@@ -555,7 +555,7 @@ namespace Ink_Canvas.Helpers
object view = null;
object selection = null;
object slideRange = null;
try
{
if (PPTApplication != null && Marshal.IsComObject(PPTApplication))
@@ -605,7 +605,7 @@ namespace Ink_Canvas.Helpers
if (view != null)
{
dynamic viewObj = view;
CurrentSlide = viewObj.Slide as Slide;
CurrentSlide = viewObj.Slide as Slide;
}
}
}
@@ -632,7 +632,7 @@ namespace Ink_Canvas.Helpers
}
}
}
if (CurrentSlide == null && SlidesCount > 0)
{
CurrentSlide = CurrentSlides[1];
+1 -3
View File
@@ -3535,7 +3535,6 @@ namespace Ink_Canvas
ToggleSwitchInkFadeInPanel2.IsOn = Settings.Canvas.EnableInkFade;
}
LogHelper.WriteLogToFile($"墨迹渐隐功能已{(Settings.Canvas.EnableInkFade ? "" : "")}", LogHelper.LogType.Event);
}
catch (Exception ex)
{
@@ -3587,7 +3586,6 @@ namespace Ink_Canvas
ToggleSwitchInkFadeInPanel2.IsOn = Settings.Canvas.EnableInkFade;
}
LogHelper.WriteLogToFile($"批注子面板中墨迹渐隐功能已{(Settings.Canvas.EnableInkFade ? "" : "")}", LogHelper.LogType.Event);
}
catch (Exception ex)
{
@@ -4812,4 +4810,4 @@ namespace Ink_Canvas
#endregion
}
}
}
+1 -2
View File
@@ -1441,7 +1441,6 @@ namespace Ink_Canvas
if (_eraserAutoSwitchBackTimer != null)
{
_eraserAutoSwitchBackTimer.Stop();
LogHelper.WriteLogToFile("橡皮擦自动切换计时器已停止", LogHelper.LogType.Trace);
}
}
catch (Exception ex)
@@ -1486,4 +1485,4 @@ namespace Ink_Canvas
}
}
}
}
}