longer update notification time

This commit is contained in:
Paddy Xu
2017-07-23 15:00:18 +03:00
parent b0e8a29f85
commit 45b7361e79
2 changed files with 6 additions and 3 deletions

View File

@@ -68,7 +68,9 @@ namespace QuickLook.Helpers
ViewWindowManager.GetInstance().InvokeViewer(changeLogPath); ViewWindowManager.GetInstance().InvokeViewer(changeLogPath);
TrayIconManager.GetInstance().ShowNotification("", TrayIconManager.GetInstance().ShowNotification("",
string.Format(TranslationHelper.GetString("Update_Found"), nVersion), string.Format(TranslationHelper.GetString("Update_Found"), nVersion),
clickEvent: () => Process.Start( timeout: 20000,
clickEvent:
() => Process.Start(
@"https://github.com/xupefei/QuickLook/releases/latest")); @"https://github.com/xupefei/QuickLook/releases/latest"));
}); });
} }

View File

@@ -66,10 +66,11 @@ namespace QuickLook
_icon.Visible = false; _icon.Visible = false;
} }
public void ShowNotification(string title, string content, bool isError = false, Action clickEvent = null, public void ShowNotification(string title, string content, bool isError = false, int timeout = 5000,
Action clickEvent = null,
Action closeEvent = null) Action closeEvent = null)
{ {
_icon.ShowBalloonTip(5000, title, content, isError ? ToolTipIcon.Error : ToolTipIcon.Info); _icon.ShowBalloonTip(timeout, title, content, isError ? ToolTipIcon.Error : ToolTipIcon.Info);
_icon.BalloonTipClicked += OnIconOnBalloonTipClicked; _icon.BalloonTipClicked += OnIconOnBalloonTipClicked;
_icon.BalloonTipClosed += OnIconOnBalloonTipClosed; _icon.BalloonTipClosed += OnIconOnBalloonTipClosed;