private void LoadSeriesHandler(MessageBoxResponse response = MessageBoxResponse.OK) { try { Logger.LogFuncUp(); if (response != MessageBoxResponse.OK) { return; } var filmingCard = FilmingViewerContainee.FilmingViewerWindow as FilmingCard; if (filmingCard == null) { return; } IsQuit = false; this.CloseParentDialog(); filmingCard.LoadSeries(viewModel); Logger.LogFuncDown(); } catch (Exception ex) { Logger.LogFuncException(ex.Message + ex.StackTrace); throw; } }
private void ProtocolConfigureDialogClosed(object sender, CancelEventArgs args) { //_protocolBindingLayoutControl = null; //Card.HostAdornerCount--; bool isClose = true; _bProtocolSettingClosing = true; if (_protocolBindingLayoutControl != null && _protocolBindingLayoutControl.IsChanged) { MessageBoxType messagetype = MessageBoxType.YesNoCancel; MessageBoxResponse rs = MessageBoxHandler.Instance.ShowQuestion("UID_Filming_Protocol_CloseHint", new MsgResponseHander(CloseHandler), messagetype, "UID_MessageBox_Title_Info", _protocolBindingLayoutControl.FindAncestorWindow()); if (rs == MessageBoxResponse.CANCEL || rs == MessageBoxResponse.NONE) { args.Cancel = true; isClose = false; _bProtocolSettingClosing = false; } } SetButtonState(isClose); if (isClose) { Logger.Instance.LogDevInfo(FilmingUtility.FunctionTraceEnterFlag + "[CustomCellLayoutWindow.ProtocolConfigureDialogClosed]" + "[sender, args]"); ProtocolConfigureButtonInViewport.IsEnabled = true; Keyboard.Focus(columnViewportNumberLabel); } }
public void HandleObject_Echo(Socket socket, MessageEcho messageEcho) { // Creates new MessageEcho object containing the same text MessageBoxResponse echo = new MessageBoxResponse($"'{messageEcho.Text}'", "Echo"); PrintMessage($"IN {socket.RemoteEndPoint} '{messageEcho.Text}'"); PrintMessage($"OUT {socket.RemoteEndPoint} '{messageEcho.Text}'"); // Sends the MessageBoxResponse to client SendObject(echo, socket); }
//static List<DialogPresenter> dialogStack = new List<DialogPresenter>(); // 簡潔なやつ public static MessageBoxResponse MessageBox(string title, string description, Buttons buttons = Buttons.OK) { var response = new MessageBoxResponse(); Open <MessageBox>(x => { x.ResetView(title, description); x.OnYes.Subscribe(_ => OnClickDialogButton(x, response, Response.OK)); x.OnNo.Subscribe(_ => OnClickDialogButton(x, response, Response.NO)); }); return(response); }
private void CloseHandler(MessageBoxResponse response = MessageBoxResponse.OK) { try { Logger.LogFuncUp(); if (response != MessageBoxResponse.YES) { return; } _protocolBindingLayoutControl.SaveProtocolLayouts(); Logger.LogFuncDown(); } catch (Exception ex) { Logger.LogFuncException(ex.Message + ex.StackTrace); //throw; } }
private void DoBatchFilmHandler(MessageBoxResponse response = MessageBoxResponse.YES) { var filmingCard = FilmingViewerContainee.FilmingViewerWindow as FilmingCard; if (filmingCard == null) { return; } try { Logger.LogFuncUp(); if (response == MessageBoxResponse.NO) { return; } if (response == MessageBoxResponse.YES) { filmingCard.DeleteAllFilmPage(); filmingCard.OnAddFilmPageAfterClearFilmingCard(null, null); } IsQuit = false; CombinePrint.CloseParentDialog(); filmingCard.DisableUI(); filmingCard.layoutCtrl.DoBatchFilm(); CreateMemento(); Logger.LogFuncDown(); } catch (Exception ex) { Logger.LogFuncException(ex.Message + ex.StackTrace); filmingCard.EnableUI(); throw; } }
private void ClearAndLoadImageHandler(MessageBoxResponse response = MessageBoxResponse.YES) { try { Logger.LogFuncUp(); if (response == MessageBoxResponse.NO) { return; } var filmingCard = FilmingViewerContainee.FilmingViewerWindow as FilmingCard; if (filmingCard == null) { return; } if (response == MessageBoxResponse.YES) { filmingCard.DeleteAllFilmPage(); } var filmingPageControl = filmingCard.EntityFilmingPageList.LastOrDefault(); if (filmingPageControl != null && filmingPageControl.IsAnyImageLoaded()) { MessageBoxHandler.Instance.ShowInfo("UID_Filming_Warning_NewFilmPageForLoadSeries", LoadSeriesHandler); } //else //{ LoadSeriesHandler(); //} Logger.LogFuncDown(); } catch (Exception ex) { Logger.LogFuncException(ex.Message + ex.StackTrace); throw; } }
private void LoadSeriesCompareHandler(MessageBoxResponse response = MessageBoxResponse.OK) { try { Logger.LogFuncUp(); if (response != MessageBoxResponse.OK) { return; } var filmingCard = FilmingViewerContainee.FilmingViewerWindow as FilmingCard; if (filmingCard == null) { return; } WindowHostManagerWrapper.IsQuittingJob = false; //WindowHostManagerWrapper.CloseSecondaryWindow(); this.CloseParentDialog(); OnSeriesCompareSettingChangedHandler(); //FilmingHelper.WriteMultiSeriesCompareConfigByNode(RowNodeName, CellRowsIndex); //FilmingHelper.WriteMultiSeriesCompareConfigByNode(ColNodeName, CellColumnsIndex); //FilmingHelper.WriteMultiSeriesCompareConfigByNode(OrientNodeName, IsVertical ? 0 : 1); Printers.Instance.MultiSeriesCompareOrientIndex = IsVertical ? 0 : 1; Printers.Instance.MultiSeriesCompareColIndex = CellColumnsIndex; Printers.Instance.MultiSeriesCompareRowIndex = CellRowsIndex; Logger.LogFuncDown(); } catch (Exception ex) { Logger.LogFuncException(ex.Message + ex.StackTrace); throw; } }
private void DoInterleavedDeleteThresholdHandler(MessageBoxResponse response = MessageBoxResponse.YES) { try { Logger.LogFuncUp(); if (response != MessageBoxResponse.YES) { return; } IsQuit = false; this.CloseParentDialog(); DoInterleavedDelete(); Logger.LogFuncDown(); } catch (Exception ex) { Logger.LogFuncException(ex.Message + ex.StackTrace); throw; } }
/// <summary> /// Shows a message box with the given parameters. /// </summary> /// <param name="scene"> A <see cref="Scene"/> to show it on. </param> /// <param name="icon"> Which <see cref="MessageBoxIcon"/> to show next to the message. </param> /// <param name="message"> The bosy of the message. </param> /// <param name="responses"> The possible <see cref="MessageBoxResponse"/>. A button will be made for each one. </param> /// <returns> The <see cref="MessageBox"/> that was created. </returns> public static MessageBox Show(Scene scene, MessageBoxIcon icon, string message, MessageBoxResponse responses) { var box = new MessageBox() { Icon = icon }; // add the buttons foreach (var val in Enum.GetValues(typeof(MessageBoxResponse))) { var response = (MessageBoxResponse)val; if ((responses & response) == response) { box.AddButton(response); } } // set the message and icon box.Message = message; // show the box scene.ShowModal(box); return box; }
public void HandleObject_BoxResponse(MessageBoxResponse messageBoxResponse) { // Displays message from server as pop-up box MessageBox.Show(messageBoxResponse.Text, messageBoxResponse.Caption); }
private void LoadStudiesHandler(MessageBoxResponse response = MessageBoxResponse.YES) { if (response != MessageBoxResponse.YES) { return; } try { Logger.LogFuncUp(); #region [--Image Loading Performance Optimization--] // NewStudyAdded(this, new StudyListEventArgs(_toBeLoadedStudies)); #endregion //[--Image Loading Performance Optimization--] var db = FilmingDbOperation.Instance.FilmingDbWrapper; foreach (var uid in _toBeLoadedStudies) { _studyListViewModel.AddStudy(db.GetStudyByStudyInstanceUID(uid)); if (_originalStudyUid == null) { _originalStudyUid = uid; } FilmingDbOperation.Instance.Lock(uid); var serieses = db.GetSeriesListByStudyInstanceUID(uid).Where(s => s.ReconResult == 1); //find series not recon completed foreach (var seriesBase in serieses) { _studyListViewModel.RemoveSereis(seriesBase.SeriesInstanceUID); Logger.LogWarning("Series" + seriesBase.SeriesInstanceUID + "No.:" + seriesBase.SeriesNumber + "ReconResult is 1 ,Recon does not complete!"); } var loadedSeries = db.GetSeriesListByStudyInstanceUID(uid).Where(s => s.ReconResult != 1); foreach (var series in loadedSeries) { var seriesResult = db.GetImageListBySeriesInstanceUID(series.SeriesInstanceUID); if (seriesResult == null || seriesResult.Count == 0) { continue; } var isHasSeries = seriesResult.All(image => (image != null && (image.Rows == 0 || image.Columns == 0))); if (isHasSeries) //禁掉全是非图像数据的系列 { var seriesTreeViewItemModel = _studyListViewModel.GetSeriesItemByUID(series.SeriesInstanceUID); seriesTreeViewItemModel.IsEnabled = false; Logger.LogWarning("Series" + series.SeriesInstanceUID + "No.:" + series.SeriesNumber + "Only has dicoms those can not be print!"); } } } Logger.LogFuncDown(); } catch (Exception ex) { Logger.LogFuncException(ex.Message + ex.StackTrace); //throw; } }
private async void mbAskForReview_Response(object sender, MessageBoxResponse e) { try { switch (e.Response) { // Review case 0: try { if (ApiInformation.IsMethodPresent("Windows.Services.Store.StoreRequestHelper", "SendRequestAsync")) { var result = await Windows.Services.Store.StoreRequestHelper.SendRequestAsync( Windows.Services.Store.StoreContext.GetDefault(), 16, String.Empty); // If showing dialog succeeded if (result.ExtendedError == null) { // We don't want exceptions parsing here to cause fallback behavior try { var jsonObject = Newtonsoft.Json.Linq.JObject.Parse(result.Response); string status = jsonObject.SelectToken("status")?.ToString() ?? ""; var props = new Dictionary <string, string>() { { "Status", status } }; if (status == "success") { bool updated = jsonObject.SelectToken("data")?.Value <bool>("updated") ?? false; props.Add("Updated", updated.ToString()); } TelemetryExtension.Current?.TrackEvent("ReviewAppResponse", props); } catch (Exception ex) { TelemetryExtension.Current?.TrackException(ex); } // We don't continue falling back at all return; } TelemetryExtension.Current?.TrackException(result.ExtendedError); } } catch (Exception ex) { TelemetryExtension.Current?.TrackException(ex); // Fall back to normal } await Launcher.LaunchUriAsync(new Uri("ms-windows-store://review/?ProductId=9wzdncrfj25v")); break; // Email dev case 1: AboutView.EmailDeveloper(ViewModel); break; } } catch (Exception ex) { TelemetryExtension.Current?.TrackException(ex); } }
void MsgBoxEvent(MessageBoxResponse response) { print("Message box response: " + response); }
// レスポンスを決定して閉じる static void OnClickDialogButton(DialogPresenter dialog, MessageBoxResponse messageBoxResponse, Response response) { messageBoxResponse.Done(response); Close(dialog); }
/// <summary> /// Adds a button for the given response type. /// </summary> public void AddButton(MessageBoxResponse buttonType) { var button = new Button(buttonType.ToString().InsertCamelSpaces()) { ButtonStyle = ButtonStyle.Label }; button.Clicked += delegate { CurrentResponse = buttonType; Close(); }; _buttonStack.AddChild(button); }
private void ExitingSecondaryUI(MessageBoxResponse response) { FilmingViewerContainee.Main.OnExitSecondaryUI(); }