예제 #1
0
        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);
        }
예제 #2
0
        // 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);
            };
        }