示例#1
0
        private static IDisposable ShowDesktopWindow(int number)
        {
            var vmodel = new NotificationWindowViewModel
            {
                Title = ProductInfo.Title,
                Body  = GetDesktopName(number),
            };
            var source = new CancellationTokenSource();

            var settings = Settings.General.Display.Value;

            Monitor[] targets;
            if (settings == 0)
            {
                targets = new[] { MonitorService.GetCurrentArea() };
            }
            else
            {
                var monitors = MonitorService.GetAreas();
                if (settings == uint.MaxValue)
                {
                    targets = monitors;
                }
                else
                {
                    targets = new[] { monitors[settings - 1] };
                }
            }
            var windows = targets.Select(area =>
            {
                var window = new SwitchWindow(area.WorkArea)
                {
                    DataContext = vmodel,
                };
                window.Show();
                return(window);
            }).ToList();

            Task.Delay(TimeSpan.FromMilliseconds(Settings.General.NotificationDuration), source.Token)
            .ContinueWith(_ => windows.ForEach(window => window.Close()), TaskScheduler.FromCurrentSynchronizationContext());

            return(Disposable.Create(() => source.Cancel()));
        }
        public void TestFlightBooking()
        {
            DateTime depdateValue    = DateTime.Now.AddDays(2);
            string   depatureDate    = depdateValue.ToString("ddd") + " " + depdateValue.ToString("MMM dd yyyy");
            DateTime returndateValue = DateTime.Now.AddDays(3);
            string   returnDate      = returndateValue.ToString("ddd") + " " + returndateValue.ToString("MMM dd yyyy");

            actor.AttemptsTo(FlightBooking.For("Goa", "Mumbai", depatureDate, returnDate, 1, 1, "Economy"));
            actor.AttemptsTo(Click.On(FlightBookingPage.SearchButton));
            actor.AttemptsTo(Click.On(FlightBookingPage.DepFlight));
            actor.AttemptsTo(Click.On(FlightBookingPage.ReturnFlight));
            Thread.Sleep(3000);
            actor.AttemptsTo(Click.On(FlightBookingPage.BookNowButton));
            actor.AttemptsTo(Click.On(FlightBookingPage.ContinueButton));

            actor.AttemptsTo(SwitchWindow.To(actor.AskingFor(WindowHandle.Last())));
            actor.WaitsUntil(Appearance.Of(FlightConfirmationPage.DepartureFlightDetails), IsEqualTo.True());
            actor.WaitsUntil(Appearance.Of(FlightConfirmationPage.ReturnFlightDetails), IsEqualTo.True());
        }
 private void LoginButton_Click(object sender, RoutedEventArgs e)
 {
     SwitchWindow.Switch(this, new Dashboard.Dashboard_Window());
 }
 private void AddTasksButton_Click(object sender, RoutedEventArgs e)
 {
     SwitchWindow.Switch(this, new Tasks.AddTask());
 }
 private void LogoutButton_Click(object sender, RoutedEventArgs e)
 {
     SwitchWindow.Switch(this, new Portal.Portal());
 }
 private void goToExpensesWindow(object sender, RoutedEventArgs e)
 {
     SwitchWindow.Switch(this, new Expenses.MainWindow());
 }
 private void addTaskButton_Click(object sender, RoutedEventArgs e)
 {
     // Get the task. Give to Dashboard or service
     SwitchWindow.Switch(this, new Dashboard.Dashboard_Window());
 }
示例#8
0
 private void backToExpensePage_Click(object sender, RoutedEventArgs e)
 {
     SwitchWindow.Switch(this, new MainWindow());
 }
示例#9
0
 private void saveExpenseTypeButton_Click(object sender, RoutedEventArgs e)
 {
     // Get expense type and save/call save service
     SwitchWindow.Switch(this, new MainWindow());
 }
示例#10
0
        /// <summary>
        /// Gets the latest window handle and switches to it.
        /// </summary>
        /// <param name="actor">The Screenplay actor.</param>
        public void PerformAs(IActor actor)
        {
            string handle = actor.AsksFor(WindowHandle.Latest());

            actor.AttemptsTo(SwitchWindow.To(handle));
        }
示例#11
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     SwitchWindow.Switch(this, new EditExpenses());
 }
示例#12
0
 private void addExpenseTypeButton_Click(object sender, RoutedEventArgs e)
 {
     SwitchWindow.Switch(this, new AddExpenseType());
 }
示例#13
0
 private void returnToMainMenu_Click(object sender, RoutedEventArgs e)
 {
     SwitchWindow.Switch(this, new Dashboard.Dashboard_Window());
 }
        public SwitchWindowSteps()
        {
            var driver = ScenarioContext.Current.Get <IWebDriver>("currentDriver");

            _switchWindow = new SwitchWindow(driver);
        }
示例#15
0
 private void naruSwitch_Click(object sender, RoutedEventArgs e)
 {
     SwitchWindow.Switch(this, new Dashboard.Dashboard_Window(true));
 }
示例#16
0
 private void backButton_Click(object sender, RoutedEventArgs e)
 {
     SwitchWindow.Switch(this, new MainWindow());
 }