public TrayApplication(TrayIcon trayIcon) { TrayIcon = trayIcon ?? throw new ArgumentNullException(nameof(trayIcon)); TrayIcon.Application = this; TrayIcon.Disposed += (sender, args) => { this.Exit(); }; }
public static void Run(TrayIcon trayIcon) { new TrayApplication(trayIcon).Start(); }