Small event-handler code fix.

This commit is contained in:
RKrom 2014-06-17 10:37:41 +02:00
commit c7aa3ebaf1
2 changed files with 7 additions and 5 deletions

View file

@ -425,15 +425,18 @@ namespace Greenshot {
}
private void BalloonTipClicked(object sender, EventArgs e) {
BalloonTipClosed(sender, e);
ShowSetting();
try {
ShowSetting();
} finally {
BalloonTipClosed(sender, e);
}
}
private void BalloonTipClosed(object sender, EventArgs e) {
notifyIcon.BalloonTipClicked -= BalloonTipClicked;
notifyIcon.BalloonTipClosed -= BalloonTipClosed;
}
private void HandleDataTransport(CopyDataTransport dataTransport) {
foreach(KeyValuePair<CommandEnum, string> command in dataTransport.Commands) {
LOG.Debug("Data received, Command = " + command.Key + ", Data: " + command.Value);

View file

@ -105,8 +105,7 @@ namespace Greenshot.Experimental {
} catch (Exception) {
MessageBox.Show(Language.GetFormattedString(LangKey.error_openlink, downloadLink), Language.GetString(LangKey.error));
} finally {
MainForm.Instance.NotifyIcon.BalloonTipClicked -= HandleBalloonTipClick;
MainForm.Instance.NotifyIcon.BalloonTipClosed -= CleanupBalloonTipClick;
CleanupBalloonTipClick(sender, e);
}
}