public DeviceNotifierApplicationContext()
        {
            _components = new Container();
            _notifyIcon = new NotifyIcon(_components)
            {
                ContextMenuStrip = new ContextMenuStrip(),
                Icon = SystemIcons.Application, // TODO: Fix
                Text = @"Device Notifications",
                Visible = true
            };

            _notifyIcon.ContextMenuStrip.Opening += ContextMenuStripOnOpening;
            _notifyIcon.DoubleClick += (sender, args) => _notifyIcon.ContextMenuStrip.Show();

            var timer = new Timer(_components);
            var messagesForm = new MessagesForm();
            _components.Add(messagesForm);
            var mainForm = new MainForm(_notifyIcon, messagesForm, timer);
            _components.Add(mainForm);
            MainForm = mainForm;
        }
Esempio n. 2
0
 public MainForm(NotifyIcon icon, MessagesForm popup, Timer timer)
 {
     _icon = icon;
     _popup = popup;
     _timer = timer;
 }