private void initTrayIcon() { System.Windows.Forms.ContextMenu nIconMenu = new System.Windows.Forms.ContextMenu(); nIcon = new NotifyIcon(); nIconMenu.MenuItems.Add("Refresh", onClick: updateTray); nIconMenu.MenuItems.Add("Exit", exitApplication); nIcon.Icon = controllerService.getIcon(); nIcon.ContextMenu = nIconMenu; nIcon.Visible = true; }