Exemple #1
0
        public Task InitAsync(CancellationToken ct = default)
        {
            using (_logger.Timed("Initialize Tray icon"))
            {
                _tray.SetTitle("Wrido");
                _tray.DisplayBalloon(new DisplayBalloonOptions
                {
                    Title   = "Update available",
                    Content = "Click here to update to 0.1"
                });
                _tray.Show("./Electron/wrido-64x64.png", new[]
                {
                    new MenuItem {
                        Label = "Show...", Click = () => _windowManager.ShowAsync(MainWindow.WindowName, ct)
                    },
                    new MenuItem {
                        Label = "About Wrido", Click = () => _windowManager.ShowAsync(AboutWindow.WindowName, ct)
                    },
                    new MenuItem {
                        Label = "Exit", Click = () => _lifetime.StopApplication()
                    }
                });

                return(Task.CompletedTask);
            }
        }