Esempio n. 1
0
 public MessageProvider(IShortcutProvider shortcutProvider, IKeyProvider keyProvider, PopupSettings settings, IMessageMerger messageMerger)
 {
     this.shortcutProvider = shortcutProvider;
     this.keyProvider = keyProvider;
     this.messageMerger = messageMerger;
     this.settings = settings;
 }
Esempio n. 2
0
 public MessageProviderFacts()
 {
     shortcutProvider    = Substitute.For <IShortcutProvider>();
     interceptKeysSource = new Subject <InterceptKeyEventArgs>();
     messageProvider     = new MessageProvider(new KeyProvider(interceptKeysSource, new PasswordModeService()),
                                               shortcutProvider);
 }
 public MessageProvider(IShortcutProvider shortcutProvider, IKeyProvider keyProvider, PopupSettings settings, IMessageMerger messageMerger)
 {
     this.shortcutProvider = shortcutProvider;
     this.keyProvider      = keyProvider;
     this.messageMerger    = messageMerger;
     this.settings         = settings;
 }
Esempio n. 4
0
        public ShortcutAccumulator ProcessKey(IShortcutProvider shortcutProvider, KeyPress key)
        {
            if (HasCompletedValue)
            {
                return(new ShortcutAccumulator().ProcessKey(shortcutProvider, key));
            }

            if (!keys.Any())
            {
                var possibleShortcuts = shortcutProvider.GetShortcutsStartingWith(key);
                if (possibleShortcuts.Any())
                {
                    BeginShortcut(key, possibleShortcuts);
                }
                else
                {
                    Complete(key);
                }

                return(this);
            }

            Add(key);
            return(this);
        }
Esempio n. 5
0
 public void AddShortcutProvider(IShortcutProvider provider)
 {
     if (!this.ContainsShortcutProvider(provider))
     {
         this.shortcutProviders.Add(provider);
         this.UpdateHook();
     }
 }
Esempio n. 6
0
 public void RemoveShortcutProvider(IShortcutProvider provider)
 {
     if (this.shortcutProviders.IndexOf(provider) < 0)
     {
         return;
     }
     this.shortcutProviders.Remove(provider);
     this.UpdateHook();
 }
Esempio n. 7
0
        public void RemoveShortcutProvider(IShortcutProvider provider)
        {
            int index = this.shortcutProviders.IndexOf(provider);

            if (index >= 0)
            {
                this.shortcutProviders.Remove(provider);
                this.UpdateHook();
            }
        }
Esempio n. 8
0
        public MessageProviderFacts()
        {
            settingsProvider = Substitute.For <ISettingsProvider>();
            settingsProvider.GetSettings <PopupSettings>().Returns(new PopupSettings());
            shortcutProvider    = Substitute.For <IShortcutProvider>();
            interceptKeysSource = new Subject <InterceptKeyEventArgs>();
            var keyProvider = new KeyProvider(interceptKeysSource, new PasswordModeService());

            messageProvider = new MessageProvider(keyProvider, shortcutProvider, settingsProvider);
        }
Esempio n. 9
0
        public MessageProviderFacts()
        {
            shortcutProvider = Substitute.For <IShortcutProvider>();
            shortcutProvider.GetShortcutsStartingWith(Arg.Any <KeyPress>()).Returns(new List <KeyShortcut>());
            interceptKeysSource = new Subject <InterceptKeyEventArgs>();
            var source = Substitute.For <IInterceptKeys>();

            source.GetKeyStream().Returns(interceptKeysSource);
            var desktopLockEventService = Substitute.For <IDesktopLockEventService>();

            desktopLockEventService.GetSessionSwitchStream().Returns(Observable.Never <SessionSwitchEventArgs>());
            keysStream      = new KeyProvider(source, new PasswordModeService(), desktopLockEventService).GetKeyStream();
            messageProvider = new MessageProvider(shortcutProvider, new PopupSettings(), new MessageMerger());
        }
Esempio n. 10
0
        public ShortcutAccumulator ProcessKey(IShortcutProvider shortcutProvider, KeyPress key)
        {
            if (HasCompletedValue)
                return new ShortcutAccumulator().ProcessKey(shortcutProvider, key);

            if (!keys.Any())
            {
                var possibleShortcuts = shortcutProvider.GetShortcutsStartingWith(key);
                if (possibleShortcuts.Any())
                    BeginShortcut(key, possibleShortcuts);
                else
                    Complete(key);

                return this;
            }

            Add(key);
            return this;
        }
Esempio n. 11
0
 public RadShortcutCollection(IShortcutProvider owner)
 {
     this.owner = owner;
     this.list  = new List <RadShortcut>();
 }
 public MessageProviderFacts()
 {
     shortcutProvider = Substitute.For <IShortcutProvider>();
     shortcutProvider.GetShortcutsStartingWith(Arg.Any <KeyPress>()).Returns(new List <KeyShortcut>());
 }
Esempio n. 13
0
 public MessageProviderFacts()
 {
     shortcutProvider = Substitute.For<IShortcutProvider>();
     shortcutProvider.GetShortcutsStartingWith(Arg.Any<KeyPress>()).Returns(new List<KeyShortcut>());
     
 }
Esempio n. 14
0
 public MessageProvider(IKeyProvider keyProvider, IShortcutProvider shortcutProvider, ISettingsProvider settingsProvider)
 {
     this.shortcutProvider = shortcutProvider;
     settings  = settingsProvider.GetSettings <PopupSettings>();
     keyStream = keyProvider.Subscribe(this);
 }
Esempio n. 15
0
 public bool ContainsShortcutProvider(IShortcutProvider provider)
 {
     return(this.shortcutProviders.IndexOf(provider) >= 0);
 }
Esempio n. 16
0
 public MessageProvider(IShortcutProvider shortcutProvider, IKeyProvider keyProvider, PopupSettings settings)
 {
     this.shortcutProvider = shortcutProvider;
     this.keyProvider      = keyProvider;
     this.settings         = settings;
 }
Esempio n. 17
0
 public MessageProvider(IKeyProvider keyProvider, IShortcutProvider shortcutProvider)
 {
     this.shortcutProvider = shortcutProvider;
     keyStream             = keyProvider.Subscribe(this);
 }