mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-12-13 02:00:25 +08:00
Compare commits
3 Commits
copilot/fi
...
copilot/fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9bcc188949 | ||
|
|
44c1559d38 | ||
|
|
f4c87f83a0 |
@@ -23,7 +23,6 @@ using System;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Windows.Forms;
|
||||
using Wpf.Ui.Violeta.Win32;
|
||||
using ToolTipIcon = Wpf.Ui.Violeta.Win32.ToolTipIcon;
|
||||
@@ -150,30 +149,9 @@ internal partial class TrayIconManager : IDisposable
|
||||
Action closeEvent = null)
|
||||
{
|
||||
var icon = GetInstance()._icon;
|
||||
|
||||
try
|
||||
{
|
||||
// Use reflection to call ShowBalloonTip to avoid JIT compilation errors
|
||||
// when the method signature doesn't match the expected one
|
||||
var showBalloonTipMethod = icon.GetType().GetMethod("ShowBalloonTip",
|
||||
new[] { typeof(int), typeof(string), typeof(string), typeof(ToolTipIcon) });
|
||||
|
||||
if (showBalloonTipMethod != null)
|
||||
{
|
||||
showBalloonTipMethod.Invoke(icon, new object[] { timeout, title, content, isError ? ToolTipIcon.Error : ToolTipIcon.Info });
|
||||
icon.BalloonTipClicked += OnIconOnBalloonTipClicked;
|
||||
icon.BalloonTipClosed += OnIconOnBalloonTipClosed;
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"ShowBalloonTip method not found: {title} - {content}");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Fallback: If reflection fails, log and continue without showing notification
|
||||
System.Diagnostics.Debug.WriteLine($"ShowBalloonTip failed: {title} - {content}. Error: {ex.Message}");
|
||||
}
|
||||
icon.ShowBalloonTip(timeout, title, content, isError ? ToolTipIcon.Error : ToolTipIcon.Info);
|
||||
icon.BalloonTipClicked += OnIconOnBalloonTipClicked;
|
||||
icon.BalloonTipClosed += OnIconOnBalloonTipClosed;
|
||||
|
||||
void OnIconOnBalloonTipClicked(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
1
_codeql_detected_source_root
Symbolic link
1
_codeql_detected_source_root
Symbolic link
@@ -0,0 +1 @@
|
||||
.
|
||||
Reference in New Issue
Block a user