Пример #1
0
        public TrayNotifier(MainWindowView owner)
        {
            _owner                     = owner;
            _trayNotifier              = new WinForms.NotifyIcon();
            _trayNotifier.DoubleClick += this.TrayNotifier_DoubleClick;
            _trayNotifier.Text         = "FASTBuild Dashboard is running. Double click to show window.";
            _trayNotifier.Visible      = true;

            _workingIconTimer = new DispatcherTimer
            {
                Interval = TimeSpan.FromSeconds(0.3)
            };

            _workingIconTimer.Tick += this.WorkingIconTimer_Tick;

            _trayNotifier.ContextMenuStrip = new WinForms.ContextMenuStrip();
            _trayNotifier.ContextMenuStrip.Items.Add("Show", GetImage("/Resources/Icons/tray_normal_16.ico"), this.TrayNotifier_DoubleClick);
            _trayNotifier.ContextMenuStrip.Items.Add(new WinForms.ToolStripSeparator());
            _trayNotifier.ContextMenuStrip.Items.Add("Work Always", GetImage("/Resources/Icons/tray_working_all_16.ico"), (sender, args) => MenuChangeWorkerMode(2));
            _trayNotifier.ContextMenuStrip.Items.Add("Work when Idle", GetImage("/Resources/Icons/tray_normal_16.ico"), (sender, args) => MenuChangeWorkerMode(1));
            _trayNotifier.ContextMenuStrip.Items.Add("Disabled", GetImage("/Resources/Icons/tray_disabled_16.ico"), (sender, args) => MenuChangeWorkerMode(0));
            _trayNotifier.ContextMenuStrip.Items.Add(new WinForms.ToolStripSeparator());
            _trayNotifier.ContextMenuStrip.Items.Add("Exit", GetImage("/Resources/Icons/tray_normal_16.ico"), TrayNotifier_Exit);
            this.UseNormalIcon();
        }
        public TrayNotifier(MainWindowView owner)
        {
            _owner                     = owner;
            _trayNotifier              = new WinForms.NotifyIcon();
            _trayNotifier.DoubleClick += this.TrayNotifier_DoubleClick;
            _trayNotifier.Text         = "FASTBuild Dashboard is running. Double click to show window.";
            _trayNotifier.Visible      = true;

            _workingIconTimer = new DispatcherTimer
            {
                Interval = TimeSpan.FromSeconds(0.3)
            };

            _workingIconTimer.Tick += this.WorkingIconTimer_Tick;

            this.UseNormalIcon();
        }