mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 05:23:24 -07:00
Introduced a very simple "singleton" service-locator, which allowed for a removal of specific implementations which were very limited. With this it's easier to access dependencies.
This commit is contained in:
parent
3ebdf3d2fe
commit
80d8f51fc5
53 changed files with 744 additions and 1230 deletions
|
@ -88,9 +88,11 @@ namespace Greenshot.Experimental {
|
|||
_latestGreenshot = null;
|
||||
ProcessRssInfo(currentVersion);
|
||||
if (_latestGreenshot != null) {
|
||||
MainForm.Instance.NotifyIcon.BalloonTipClicked += HandleBalloonTipClick;
|
||||
MainForm.Instance.NotifyIcon.BalloonTipClosed += CleanupBalloonTipClick;
|
||||
MainForm.Instance.NotifyIcon.ShowBalloonTip(10000, "Greenshot", Language.GetFormattedString(LangKey.update_found, "'" + _latestGreenshot.File + "'"), ToolTipIcon.Info);
|
||||
var notifyIcon = SimpleServiceProvider.Current.GetInstance<NotifyIcon>();
|
||||
|
||||
notifyIcon.BalloonTipClicked += HandleBalloonTipClick;
|
||||
notifyIcon.BalloonTipClosed += CleanupBalloonTipClick;
|
||||
notifyIcon.ShowBalloonTip(10000, "Greenshot", Language.GetFormattedString(LangKey.update_found, "'" + _latestGreenshot.File + "'"), ToolTipIcon.Info);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.Error("An error occured while checking for updates, the error will be ignored: ", e);
|
||||
|
@ -99,8 +101,9 @@ namespace Greenshot.Experimental {
|
|||
}
|
||||
|
||||
private static void CleanupBalloonTipClick(object sender, EventArgs e) {
|
||||
MainForm.Instance.NotifyIcon.BalloonTipClicked -= HandleBalloonTipClick;
|
||||
MainForm.Instance.NotifyIcon.BalloonTipClosed -= CleanupBalloonTipClick;
|
||||
var notifyIcon = SimpleServiceProvider.Current.GetInstance<NotifyIcon>();
|
||||
notifyIcon.BalloonTipClicked -= HandleBalloonTipClick;
|
||||
notifyIcon.BalloonTipClosed -= CleanupBalloonTipClick;
|
||||
}
|
||||
|
||||
private static void HandleBalloonTipClick(object sender, EventArgs e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue