コード例 #1
0
        public OverlayViewModel(
            HintSession session,
            IHintLabelService hintLabelService)
        {
            _bounds = session.OwningWindowBounds;

            var labels = hintLabelService.GetHintStrings(session.Hints.Count());
            for (int i = 0; i < labels.Count; ++i)
            {
                var hint = session.Hints[i];
                _hints.Add(new HintViewModel(hint)
                {
                    Label = labels[i],
                    Active = false
                });
            }
        }
コード例 #2
0
        public ShellViewModel(
            Action <OverlayViewModel> showOverlay,
            Action <DebugOverlayViewModel> showDebugOverlay,
            Action <OptionsViewModel> showOptions,
            IHintLabelService hintLabelService,
            IHintProviderService <Hint> hintProviderService,
            IHintProviderService <DebugHint> debugHintProviderService,
            IKeyListenerService keyListener)
        {
            _showOverlay      = showOverlay;
            _showDebugOverlay = showDebugOverlay;
            _showOptions      = showOptions;
            _hintLabelService = hintLabelService;
            var keyListener1 = keyListener;

            _hintProviderService      = hintProviderService;
            _debugHintProviderService = debugHintProviderService;

            keyListener1.HotKey = new HotKey
            {
                Keys     = Keys.OemSemicolon,
                Modifier = KeyModifier.Alt
            };

            keyListener1.TaskbarHotKey = new HotKey
            {
                Keys     = Keys.OemSemicolon,
                Modifier = KeyModifier.Control
            };

#if DEBUG
            keyListener1.DebugHotKey = new HotKey
            {
                Keys     = Keys.OemSemicolon,
                Modifier = KeyModifier.Alt | KeyModifier.Shift
            };
#endif

            keyListener1.OnHotKeyActivated        += _keyListener_OnHotKeyActivated;
            keyListener1.OnTaskbarHotKeyActivated += _keyListener_OnTaskbarHotKeyActivated;
            keyListener1.OnDebugHotKeyActivated   += _keyListener_OnDebugHotKeyActivated;

            ShowOptionsCommand = new DelegateCommand(ShowOptions);
            ExitCommand        = new DelegateCommand(Exit);
        }
コード例 #3
0
        public OverlayViewModel(
            HintSession session,
            IHintLabelService hintLabelService)
        {
            _bounds = session.OwningWindowBounds;

            var labels = hintLabelService.GetHintStrings(session.Hints.Count());

            for (int i = 0; i < labels.Count; ++i)
            {
                var hint = session.Hints[i];
                _hints.Add(new HintViewModel(hint)
                {
                    Label  = labels[i],
                    Active = false
                });
            }
        }