Esempio n. 1
0
        public void When_doubleClick_happens_then_it_should_be_in_TextCaptured_state()
        {
            var triggered = false;

            using var mouse = new TipsyMouse(() => { triggered = true; });

            mouse.DoubleClick();

            mouse.IsInState(State.TextCaptured).Should().BeTrue();
            triggered.Should().BeTrue();
        }
Esempio n. 2
0
        public void When_TextCaptured_with_DoubleClick_and_Release_comes_then_it_should_return_initial_state()
        {
            var triggered = false;

            using var mouse = new TipsyMouse(() => triggered = true);

            mouse.DoubleClick();
            mouse.Release();

            mouse.IsInState(State.Waiting).Should().BeTrue();
            triggered.Should().BeTrue();
        }
Esempio n. 3
0
        public void When_drag_and_finish_then_it_should_be_in_TextCaptured_state()
        {
            var triggered = false;

            using var mouse = new TipsyMouse(() => triggered = true);

            mouse.StartDragging();
            mouse.FinishDragging();

            mouse.IsInState(State.TextCaptured).Should().Be(true);
            triggered.Should().BeTrue();
        }
Esempio n. 4
0
        public void When_TextCaptured_with_Dragging_and_Release_comes_then_it_should_return_initial_state()
        {
            var triggered = false;
            var mouse     = new TipsyMouse(() => triggered = true);

            mouse.StartDragging();
            mouse.FinishDragging();

            mouse.Release();

            mouse.IsInState(State.Waiting).Should().BeTrue();
            triggered.Should().Be(true);
        }
Esempio n. 5
0
        public void When_multiple_double_drag_happens_then_it_should_continue_with_draggingFinish()
        {
            var triggered = false;

            using var mouse = new TipsyMouse(() => triggered = true);

            mouse.StartDragging();
            mouse.StartDragging();
            mouse.FinishDragging();

            mouse.IsInState(State.TextCaptured).Should().Be(true);
            triggered.Should().BeTrue();
        }
 public TranslatorBootstrapper(GrowlNotifications growlNotifications,
                               IClipboardManager clipboardManager,
                               IApplicationConfiguration applicationConfiguration,
                               IGoogleAnalyticsTracker googleAnalyticsTracker,
                               IServiceProvider serviceProvider,
                               CookieContainer cookieContainer)
 {
     this.growlNotifications       = growlNotifications;
     this.clipboardManager         = clipboardManager;
     this.applicationConfiguration = applicationConfiguration;
     this.googleAnalyticsTracker   = googleAnalyticsTracker;
     this.serviceProvider          = serviceProvider;
     this.cookieContainer          = cookieContainer;
     this.globalMouseHook          = Hook.GlobalEvents();
     this.tipsyMouse = new TipsyMouse(() =>
     {
         this.serviceProvider
         .GetRequiredService <MainWindow>()
         .Dispatcher
         .InvokeAsync(SendCopyCommand, DispatcherPriority.Input, this.cancellationTokenSource.Token);
         this.tipsyMouse.Release();
     });
     ConfigureNotificationMeasurements();
 }