private async void GallifreyOnExportPromptEvent(object sender, ExportPromptDetail e) { var timer = modelHelpers.Gallifrey.JiraTimerCollection.GetTimer(e.TimerId); if (timer != null) { var exportTime = e.ExportTime; var message = $"Do You Want To Export '{timer.JiraReference}'?\n"; if (modelHelpers.Gallifrey.Settings.ExportSettings.ExportPromptAll || (new TimeSpan(exportTime.Ticks - (exportTime.Ticks % 600000000)) == new TimeSpan(timer.TimeToExport.Ticks - (timer.TimeToExport.Ticks % 600000000)))) { exportTime = timer.TimeToExport; message += $"You Have '{exportTime.FormatAsString(false)}' To Export"; } else { message += $"You Have '{exportTime.FormatAsString(false)}' To Export For This Change"; } var messageResult = await DialogCoordinator.Instance.ShowMessageAsync(modelHelpers.DialogContext, "Do You Want To Export?", message, MessageDialogStyle.AffirmativeAndNegative, new MetroDialogSettings { AffirmativeButtonText = "Yes", NegativeButtonText = "No", DefaultButtonFocus = MessageDialogResult.Affirmative }); if (messageResult == MessageDialogResult.Affirmative) { if (modelHelpers.Gallifrey.Settings.ExportSettings.ExportPromptAll) { await modelHelpers.OpenFlyout(new Export(modelHelpers, e.TimerId, null)); } else { await modelHelpers.OpenFlyout(new Export(modelHelpers, e.TimerId, e.ExportTime)); } } } }
private void OnExportPromptEvent(object sender, ExportPromptDetail promptDetail) { if (promptDetail.ExportTime.TotalSeconds >= 60) { ExportPromptEvent?.Invoke(sender, promptDetail); } }
private void GallifreyOnExportPromptEvent(object sender, ExportPromptDetail e) { var timer = gallifrey.JiraTimerCollection.GetTimer(e.TimerId); if (timer != null) { var exportTime = e.ExportTime; var message = string.Format("Do You Want To Export '{0}'?\n", timer.JiraReference); if (gallifrey.Settings.ExportSettings.ExportPromptAll || (new TimeSpan(exportTime.Ticks - (exportTime.Ticks % 600000000)) == new TimeSpan(timer.TimeToExport.Ticks - (timer.TimeToExport.Ticks % 600000000)))) { exportTime = timer.TimeToExport; message += string.Format("You Have '{0}' To Export", exportTime.FormatAsString(false)); } else { message += string.Format("You Have '{0}' To Export For This Change", exportTime.FormatAsString(false)); } if (MessageBox.Show(message, "Do You Want To Export?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { var exportTimerWindow = new ExportTimerWindow(gallifrey, e.TimerId); if (exportTimerWindow.DisplayForm) { if (!gallifrey.Settings.ExportSettings.ExportPromptAll) { exportTimerWindow.PreLoadExportTime(e.ExportTime); } exportTimerWindow.ShowDialog(); } } } }
private async void GallifreyOnExportPromptEvent(object sender, ExportPromptDetail e) { var timer = ViewModel.Gallifrey.JiraTimerCollection.GetTimer(e.TimerId); if (timer != null) { var exportTime = e.ExportTime; var message = string.Format("Do You Want To Export '{0}'?\n", timer.JiraReference); if (ViewModel.Gallifrey.Settings.ExportSettings.ExportPromptAll || (new TimeSpan(exportTime.Ticks - (exportTime.Ticks % 600000000)) == new TimeSpan(timer.TimeToExport.Ticks - (timer.TimeToExport.Ticks % 600000000)))) { exportTime = timer.TimeToExport; message += string.Format("You Have '{0}' To Export", exportTime.FormatAsString(false)); } else { message += string.Format("You Have '{0}' To Export For This Change", exportTime.FormatAsString(false)); } var messageResult = await this.ShowMessageAsync("Do You Want To Export?", message, MessageDialogStyle.AffirmativeAndNegative, new MetroDialogSettings { AffirmativeButtonText = "Yes", NegativeButtonText = "No" }); if (messageResult == MessageDialogResult.Affirmative) { if (ViewModel.Gallifrey.Settings.ExportSettings.ExportPromptAll) { ViewModel.MainWindow.OpenFlyout(new Export(ViewModel, e.TimerId, e.ExportTime)); } else { ViewModel.MainWindow.OpenFlyout(new Export(ViewModel, e.TimerId, null)); } } } }