Beispiel #1
0
        public ViewManager()
        {
            leftIsPrimary = !System.Windows.Forms.SystemInformation.MouseButtonsSwapped;
            System.Drawing.Icon ic = leftIsPrimary ?
                                     SystemTrayApp.Properties.Resources.LeftMouseButtonActive :
                                     SystemTrayApp.Properties.Resources.RightMouseButtonActive;


            _components = new System.ComponentModel.Container();
            _notifyIcon = new System.Windows.Forms.NotifyIcon(_components)
            {
                ContextMenuStrip = new ContextMenuStrip(),
                Icon             = ic,
                Text             = "Mouser Switcher - swap your left and right mouse buttons",
                Visible          = true,
            };

            _notifyIcon.ContextMenuStrip.Opening += ContextMenuStrip_Opening;
            _notifyIcon.DoubleClick += notifyIcon_DoubleClick;
            _notifyIcon.MouseUp     += notifyIcon_MouseUp;

            _aboutViewModel = new WpfFormLibrary.ViewModel.AboutViewModel();
            //_statusViewModel = new WpfFormLibrary.ViewModel.StatusViewModel();

            //_statusViewModel.Icon = AppIcon;
            _aboutViewModel.Icon = AppIcon;

            _hiddenWindow = new System.Windows.Window();
            _hiddenWindow.Hide();
        }
Beispiel #2
0
        public ViewManager(DeviceManager deviceManager)
        {
            System.Diagnostics.Debug.Assert(deviceManager != null);

            _deviceManager = deviceManager;

            _components = new System.ComponentModel.Container();
            _notifyIcon = new System.Windows.Forms.NotifyIcon(_components)
            {
                ContextMenuStrip = new ContextMenuStrip(),
                Icon             = DbaLogger.Properties.Resources.NotReadyIcon,
                Text             = "System Tray App: Device Not Present",
                Visible          = true,
            };

            _notifyIcon.ContextMenuStrip.Opening += ContextMenuStrip_Opening;
            _notifyIcon.DoubleClick += notifyIcon_DoubleClick;
            _notifyIcon.MouseUp     += notifyIcon_MouseUp;

            _aboutViewModel  = new WpfFormLibrary.ViewModel.AboutViewModel();
            _statusViewModel = new WpfFormLibrary.ViewModel.StatusViewModel();

            _statusViewModel.Icon = AppIcon;
            _aboutViewModel.Icon  = _statusViewModel.Icon;

            _hiddenWindow = new System.Windows.Window();
            _hiddenWindow.Hide();
        }