AcManager.Controls.Helpers.AppIconService.GetAppIcon C# (CSharp) Method

GetAppIcon() private method

private GetAppIcon ( ) : Icon
return System.Drawing.Icon
        public static Icon GetAppIcon() {
            return _appIcon ?? (_appIcon = ReadIcon(GetAppIconUri()));
        }
    }

Usage Example

Example #1
0
        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) => {
                            click.InvokeInMainThreadAsync();
                        };
                    }

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