// ReSharper disable once MemberCanBePrivate.Global internal void ShowDefaultBalloonTip(object sender, MouseEventArgs e) { if (string.IsNullOrEmpty(DefaultTipText) || string.IsNullOrEmpty(DefaultTipTitle)) { return; } lock (this) { if (HaveRegisteredClickHandlers()) { return; } if (_showingDefaultBalloonTip) { return; } _showingDefaultBalloonTip = true; } ShowBalloonTipFor( DefaultBalloonTipTimeout, DefaultTipTitle, DefaultTipText, ToolTipIcon.Info, DefaultBalloonTipClickedAction, () => { _showingDefaultBalloonTip = false; _balloonTipClickHandlers = null; var closedAction = DefaultBalloonTipClosedAction; closedAction?.Invoke(); }); }
/// <inheritdoc /> public void ShowBalloonTipFor(int timeoutInMilliseconds, string title, string text, ToolTipIcon icon, Action clickAction = null, Action closeAction = null) { lock (this) { _balloonTipClickHandlers = new BalloonTipClickHandlerRegistration(clickAction, closeAction); } NotificationIcon.ShowBalloonTip(timeoutInMilliseconds, title, text, icon); }