public MessageProvider(IShortcutProvider shortcutProvider, IKeyProvider keyProvider, PopupSettings settings, IMessageMerger messageMerger) { this.shortcutProvider = shortcutProvider; this.keyProvider = keyProvider; this.messageMerger = messageMerger; this.settings = settings; }
public MessageProviderFacts() { shortcutProvider = Substitute.For <IShortcutProvider>(); interceptKeysSource = new Subject <InterceptKeyEventArgs>(); messageProvider = new MessageProvider(new KeyProvider(interceptKeysSource, new PasswordModeService()), shortcutProvider); }
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); }
public void AddShortcutProvider(IShortcutProvider provider) { if (!this.ContainsShortcutProvider(provider)) { this.shortcutProviders.Add(provider); this.UpdateHook(); } }
public void RemoveShortcutProvider(IShortcutProvider provider) { if (this.shortcutProviders.IndexOf(provider) < 0) { return; } this.shortcutProviders.Remove(provider); this.UpdateHook(); }
public void RemoveShortcutProvider(IShortcutProvider provider) { int index = this.shortcutProviders.IndexOf(provider); if (index >= 0) { this.shortcutProviders.Remove(provider); this.UpdateHook(); } }
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); }
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()); }
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; }
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>()); }
public MessageProviderFacts() { shortcutProvider = Substitute.For<IShortcutProvider>(); shortcutProvider.GetShortcutsStartingWith(Arg.Any<KeyPress>()).Returns(new List<KeyShortcut>()); }
public MessageProvider(IKeyProvider keyProvider, IShortcutProvider shortcutProvider, ISettingsProvider settingsProvider) { this.shortcutProvider = shortcutProvider; settings = settingsProvider.GetSettings <PopupSettings>(); keyStream = keyProvider.Subscribe(this); }
public bool ContainsShortcutProvider(IShortcutProvider provider) { return(this.shortcutProviders.IndexOf(provider) >= 0); }
public MessageProvider(IShortcutProvider shortcutProvider, IKeyProvider keyProvider, PopupSettings settings) { this.shortcutProvider = shortcutProvider; this.keyProvider = keyProvider; this.settings = settings; }
public MessageProvider(IKeyProvider keyProvider, IShortcutProvider shortcutProvider) { this.shortcutProvider = shortcutProvider; keyStream = keyProvider.Subscribe(this); }