AcManager.Controls.Helpers.Toast.ShowFallback C# (CSharp) Метод

ShowFallback() приватный статический Метод

private static ShowFallback ( string title, string message, [ icon, System.Action click ) : void
title string
message string
icon [
click System.Action
Результат void
        private static void ShowFallback(string title, string message, [NotNull] Uri icon, Action click) {
            try {
                var text = title + Environment.NewLine + message;
                using (var notifyIcon = new NotifyIcon {
                    Icon = AppIconService.GetAppIcon(),
                    Text = text.Length > 63 ? text.Substring(0, 63) : text
                }) {
                    notifyIcon.Visible = true;

                    if (click != null) {
                        notifyIcon.BalloonTipClicked += (sender, args) => {
                            Application.Current.Dispatcher.Invoke(click);
                        };
                    }

                    notifyIcon.ShowBalloonTip(5000, title, message, ToolTipIcon.Info);
                    notifyIcon.Visible = false;
                }
            } catch (Exception e) {
                Logging.Error(e);
            }
        }
    }