private void LoginExpiredOpenedEventHandler(object sender, DialogOpenedEventArgs eventArgs) { //Task.Delay(TimeSpan.FromSeconds(3)) //.ContinueWith( // (t, _) => // { // eventArgs.Session.Close(); // }, null, TaskScheduler.FromCurrentSynchronizationContext());//关闭程序 Task.Factory.StartNew(() => Thread.Sleep(3000)) .ContinueWith(t => { if (eventArgs.Session == null || eventArgs.Session.IsEnded == true) { GlobalUser.LoginWin.Focus(); return; } eventArgs.Session.Close(); GlobalUser.LoginWin.Focus(); }, TaskScheduler.FromCurrentSynchronizationContext()); }
private async void DialogHost_DialogOpened(object sender, DialogOpenedEventArgs eventArgs) { PowerShellExecution pse = new PowerShellExecution(); string result = await pse.ExecuteShellScript(scriptsDirectory + "test.ps1"); string message = ""; if (result.Length > 0) { message = "Vous disposez d'un proxy, veuillez configurer l'adresse ci-dessous dans les paramètres de Docker"; } else { message = "Vous ne disposez pas de proxy, veuillez modifier ce paramètre dans Docker, s'il était activé auparavant"; } var person = new Proxy { Address = result, Message = message }; this.dialogProgress.IsOpen = false; await this.dialogInfo.ShowDialog(person); }
private async void RunQuery(ExplicitConnection explicitConnection, int?maxItemCount, string query, EventWaitHandle waitHandle, CancellationTokenSource source, DialogOpenedEventArgs args) { ResultSetExplorer.SelectedRow = -1; ResultSetExplorer.ResultSet = null; await Task <ResultSet> .Factory .StartNew(() => { ResultSet resultSet = null; Task.Factory.StartNew(async() => { resultSet = await RunQuery(explicitConnection, maxItemCount, query); waitHandle.Set(); }, source.Token); waitHandle.WaitOne(); source.Token.ThrowIfCancellationRequested(); return(resultSet); }, source.Token) .ContinueWith(task => { ResultSetExplorer.ResultSet = task.IsCanceled ? new ResultSet("Cancelled") : task.Result; args.Session.Close(); }, TaskScheduler.FromCurrentSynchronizationContext()); }
protected virtual void OnDialogOpened(DialogOpenedEventArgs e) { if (DialogOpened != null) { DialogOpened(this, e); } }
private void OpenDialogInterface_DialogOpened(object sender, DialogOpenedEventArgs e) { if (_currentFill != null) { _currentFill.Reset(); } }
private void Settings_DialogOpened(object sender, DialogOpenedEventArgs eventArgs) { if (!(eventArgs.Session.Content is SettingsView _)) { return; } }
public void CombinedDialogOpenedEventHandler(object sender, DialogOpenedEventArgs eventArgs) { calendar(Visibility.Hidden); CombinedCalendar.SelectedDate = ((PickersViewModel)DataContext).Date; CombinedClock.Time = ((PickersViewModel)DataContext).Time; }
/// <summary> /// Opens up a dialog to create a new playlist. /// </summary> /// <param name="sender">Button</param> /// <param name="e">Event</param> private void NewPlaylistButton_Click(object sender, RoutedEventArgs e) { DialogHost.Show(mainStackPanel, "PlaylistsPage_WindowDialogHost", (openSender, openEventArgs) => { dialogOpenEventArgs = openEventArgs; dialogCreatePlaylistGrid.Visibility = Visibility.Visible; }, null); }
/// <summary> /// Opens up a dialog to add to play queue. /// </summary> /// <param name="sender">MenuItem</param> /// <param name="e">Event</param> private void AddToQueueButton_Click(object sender, RoutedEventArgs e) { DialogHost.Show(mainStackPanel, "ConsultAlbumPage_WindowDialogHost", (openSender, openEventArgs) => { dialogOpenEventArgs = openEventArgs; dialogAddToQueueGrid.Visibility = Visibility.Visible; }, null); }
private void OnDialogOpened(object sender, DialogOpenedEventArgs eventArgs) { if (eventArgs.Session.Content is IViewModel viewModel) { viewModel.OnDialogOpened(); } }
public void OpenHandle(object sender, DialogOpenedEventArgs args) { this.openedTime = DateTime.Now; var closableViewModel = args.Session.Content as BasePrismViewModel; closableViewModel?.FromEventHandler(v => closableViewModel.Closed += v, v => closableViewModel.Closed -= v).Subscribe(v => args.Session.Close()); }
private async void IllustBrowserDialogHost_OnDialogOpened(object sender, DialogOpenedEventArgs e) { var context = sender.GetDataContext <Illustration>(); var list = new ObservableCollection <TransitionerSlide>(); var template = new IllustTransitioner(list); IllustBrowserContainer.Children.Insert(1, template); if (context.IsManga) { if (context.MangaMetadata.IsNullOrEmpty()) { context = await PixivHelper.IllustrationInfo(context.Id); } var tasks = await Tasks <Illustration, (BitmapImage image, Illustration illust)> .Of(context.MangaMetadata) .Mapping(illustration => Task.Run(async() => (await PixivEx.FromUrl(illustration.Large), illustration))) .Construct() .WhenAll(); list.AddRange(tasks.Select(i => InitTransitionerSlide(i.image, i.illust))); } else { list.Add(InitTransitionerSlide(await PixivEx.FromUrl(context.Large), context)); } }
private static void OnDialogOpened(object sender, DialogOpenedEventArgs eventArgs) { var host = (DialogHost)sender; var dialog = GetDialog(host); dialog.OnOpened(); }
private void LoadingDialogOpenedEventHandler(object sender, DialogOpenedEventArgs eventArgs) { IEnumerable <SynchronousDb> SynchronousDbs = dataBaseService.GetSynchronousDbs(); Database = AutoMapper.Mapper.Map <IEnumerable <SynchronousDbViewModel> >(SynchronousDbs); eventArgs.Session.Close(false); }
async void OnDialogOpenedAsync(object sender, DialogOpenedEventArgs eventArgs) { if (eventArgs.Session.Content is IViewModel viewModel) { await viewModel.OnDialogOpenedAsync(); } }
private void ExtendedOpenedEventHandler(object sender, DialogOpenedEventArgs eventargs) { //lets run a fake operation for 5 seconds then close this baby. //Task.Delay(TimeSpan.FromSeconds(3)) // .ContinueWith( // (t, _) => // { // eventargs.Session.Close(); // //跳转到 列表 // Messenger.Default.Send(new NavigateMessage(), "ShowUserpapers"); // }, null, // TaskScheduler.FromCurrentSynchronizationContext());//关闭程序 Task.Factory.StartNew(() => Thread.Sleep(1000)) .ContinueWith(t => { eventargs.Session.Close(); //跳转到 列表 //Messenger.Default.Send(new NavigateMessage(), "ShowUserpapers"); //Messenger.Default.Send(new NavigateMessage(MenuExamVM.ViewName, "R", true), "ShowUserpapers"); Messenger.Default.Send(new NavigateMessage(null, "NewCard", true), "ShowUserpapers"); }, TaskScheduler.FromCurrentSynchronizationContext()); }
private void Search_DialogHost_OnDialogOpening(object sender, DialogOpenedEventArgs eventArgs) { OperationsHistory = null; //lets run a fake operation for 3 seconds then close this baby. Task.Delay(TimeSpan.FromSeconds(3)) .ContinueWith((t, _) => eventArgs.Session.Close(false), null, TaskScheduler.FromCurrentSynchronizationContext()); }
//when DialogHostLogIn is opened, execute the following code private void DialogHostLogIn_DialogOpened(object sender, DialogOpenedEventArgs eventArgs) { TextBoxUserName.Text = TextBoxNameInput.Text; Console.WriteLine("Login Opened"); Dispatcher.Invoke(new Action(() => { PasswordBoxUserPassword.Focus(); Console.WriteLine("Set focus on PasswordBox"); })); //Keyboard.Focus(PasswordBoxUserPassword); }
private void InputThing_DialogOpened(object sender, DialogOpenedEventArgs eventArgs) { if (!(eventArgs.Session.Content is InputThingView inputThingView)) { return; } // Make sure that items list is clear when we start new dialog. inputThingView.ClearAllView(); }
private void ExtendedOpenedEventHandler(object sender, DialogOpenedEventArgs eventargs) { Console.WriteLine("You could intercept the open and affect the dialog using eventArgs.Session."); if (this.SelectedReservoir != null) { var dialog = eventargs.Session.Content as ReservoirAddDialog; dialog.TextReservoirName.Text = SelectedReservoir.Name; } }
private void EnterData_DialogOpened(object sender, DialogOpenedEventArgs eventArgs) { if (!(eventArgs.Session.Content is EnterDataView enterDataView)) { return; } // Make sure that text box is clear when we start new dialog. enterDataView.Clear(); }
private void CreateToplist_DialogOpened(object sender, DialogOpenedEventArgs eventArgs) { if (!(eventArgs.Session.Content is CreateToplistView createToplistView)) { return; } // Make sure that text box is clear when we start new dialog. createToplistView.Clear(); }
private async void OpenedEventHandler(object sender, DialogOpenedEventArgs eventArgs) { await Task.Delay(3000); MainSnackbar.MessageQueue.Enqueue("Welcome to Material Design In XAML Tookit"); eventArgs.Session.Close(false); //Task.Delay(TimeSpan.FromSeconds(3)) // .ContinueWith((t, _) => eventArgs.Session.Close(false), null, TaskScheduler.FromCurrentSynchronizationContext()); }
private void ExtendedOpenedEventHandler(object sender, DialogOpenedEventArgs eventargs) { Task.Factory.StartNew(() => Thread.Sleep(1000)) .ContinueWith(t => { eventargs.Session.Close(); //跳转到 列表 Messenger.Default.Send(new NavigateMessage(ExpireCardVM.ViewName, null)); }, TaskScheduler.FromCurrentSynchronizationContext()); }
public void ClockDialogOpenedEventHandler(object sender, DialogOpenedEventArgs eventArgs) { var trigger = this.ViewModel; if (trigger == null) { return; } this._Clock.Time = trigger.Time; }
protected override void OnDialogOpened(DialogOpenedEventArgs e) { StringBuilder className = new StringBuilder(256); NativeApi.GetClassName(e.Handle, className, 255); if (className.ToString() == "#32770") { SetText(e.Handle); } base.OnDialogOpened(e); }
private void ChooseContentDirectory_DialogOpened(object sender, DialogOpenedEventArgs eventArgs) { if (!(eventArgs.Session.Content is ChooseContentDirectoryView chooseContentDirectoryView)) { return; } // Make sure that text box is clear when we start new dialog. chooseContentDirectoryView.Clear(); }
public void CalendarDialogOpenedEventHandler(object sender, DialogOpenedEventArgs eventArgs) { var trigger = this.ViewModel; if (trigger == null) { return; } this._Calendar.SelectedDate = trigger.Date; }
private void ExtendedOpenedEventHandler(object sender, DialogOpenedEventArgs eventargs) { //Task.Factory.StartNew(() => Thread.Sleep(3000)) // .ContinueWith(t => // { // eventargs.Session.Close(); // //跳转到 列表 // Messenger.Default.Send(new NavigateMessage(), "ShowUserpapers"); // }, TaskScheduler.FromCurrentSynchronizationContext()); }
public void DialogOpeningEventHandler(object sender, DialogOpenedEventArgs eventargs) { try { ((AddEditStudentViewModel)DataContext).CurrentViewModel.SwitchOn(); ((AddEditStudentViewModel)DataContext).CurrentViewModel.Biometrics = ((AddEditStudentViewModel)DataContext).Student.Biometrics; } catch (Exception error) { return; } }