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()); }
private void backToExpensePage_Click(object sender, RoutedEventArgs e) { SwitchWindow.Switch(this, new MainWindow()); }
private void saveExpenseTypeButton_Click(object sender, RoutedEventArgs e) { // Get expense type and save/call save service SwitchWindow.Switch(this, new MainWindow()); }
/// <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)); }
private void Button_Click(object sender, RoutedEventArgs e) { SwitchWindow.Switch(this, new EditExpenses()); }
private void addExpenseTypeButton_Click(object sender, RoutedEventArgs e) { SwitchWindow.Switch(this, new AddExpenseType()); }
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); }
private void naruSwitch_Click(object sender, RoutedEventArgs e) { SwitchWindow.Switch(this, new Dashboard.Dashboard_Window(true)); }
private void backButton_Click(object sender, RoutedEventArgs e) { SwitchWindow.Switch(this, new MainWindow()); }