public FormSysTray(Controller aController) { InitializeComponent(); iController = aController; iNotifyIcon.Icon = Linn.MediaServer.Properties.Resources.SysTrayIcon; }
private void ApplicationStartup(object sender, StartupEventArgs e) { // create the configuration window iWindow = new ConfigurationWindow(); iWindow.Closing += EventWindowClosing; // create the controller for the app iController = new Controller(this); // create and show the sys tray icon iFormSysTray = new FormSysTray(iController); }
public override void FinishedLaunching(NSObject notification) { // load image for the status item string imageFile = NSBundle.MainBundle.PathForImageResource("SysTrayIcon.png"); NSImage image = new NSImage(imageFile); // creating the status item with a length of -2 is equivalent to the call // [[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength] iStatusItem = NSStatusBar.SystemStatusBar.CreateStatusItem(-2); iStatusItem.HighlightMode = true; iStatusItem.Menu = StatusMenu; iStatusItem.Image = image; // create the main configuration window iWindow = new ConfigurationWindowController(); iWindow.LoadWindow(); // create the controller for the application iController = new Controller(this); }