public override void Init(string[] args) { NSApplication.Init(); m_app = NSApplication.SharedApplication; m_app.ActivateIgnoringOtherApps(true); m_statusItem = NSStatusBar.SystemStatusBar.CreateStatusItem(32); m_statusItem.HighlightMode = true; base.Init(args); }
// Call to load from the XIB/NIB file public MainWindowController() : base("MainWindow") { Initialize(); _newServer = new ConnectivityServer(true); _newServer.OnClientAskForConnection += _newServer_OnClientAskForConnection; _newServer.ClientConnected += _newServer_ClientConnected; _newServer.ClientDisconnected += _newServer_ClientDisconnected; _newServer.OnMessageReceived += HandleOnMessageReceived; _newServer.StartServer(); NSStatusItem sItem = NSStatusBar.SystemStatusBar.CreateStatusItem(25); NSStatusBarButton statBtn = sItem.Button; statBtn.Image = NSImage.ImageNamed("tbar_BarIcon"); statBtn.Activated += (sender, e) => { NSApplication app = NSApplication.SharedApplication; app.ActivateIgnoringOtherApps(true); this.Window.MakeKeyAndOrderFront(null); }; }