当前位置: 首页>>代码示例>>C#>>正文


C# IDesktopWindow.ShowMessageBox方法代码示例

本文整理汇总了C#中IDesktopWindow.ShowMessageBox方法的典型用法代码示例。如果您正苦于以下问题:C# IDesktopWindow.ShowMessageBox方法的具体用法?C# IDesktopWindow.ShowMessageBox怎么用?C# IDesktopWindow.ShowMessageBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDesktopWindow的用法示例。


在下文中一共展示了IDesktopWindow.ShowMessageBox方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ShowReconciliationDialog

        public static bool ShowReconciliationDialog(EntityRef targetProfile, IDesktopWindow window)
        {
            IList<ReconciliationCandidate> candidates = null;
            IList<PatientProfileSummary> reconciledProfiles = null;

            Platform.GetService<IPatientReconciliationService>(
                delegate(IPatientReconciliationService service)
                {
                    ListPatientReconciliationMatchesResponse response =
                        service.ListPatientReconciliationMatches(new ListPatientReconciliationMatchesRequest(targetProfile));

                    candidates = response.MatchCandidates;
                    reconciledProfiles = response.ReconciledProfiles;
                });

            if (candidates.Count > 0)
            {
                ReconciliationComponent component = new ReconciliationComponent(targetProfile, reconciledProfiles, candidates);
                ApplicationComponentExitCode exitCode = ApplicationComponent.LaunchAsDialog(
                    window,
                    component,
                    SR.TitlePatientReconciliation);
                return exitCode == ApplicationComponentExitCode.Accepted;
            }
            else
            {
                window.ShowMessageBox(SR.MessageNoReconciliationCandidate, MessageBoxActions.Ok);
                return false;
            }
        }
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:30,代码来源:PatientReconciliation.cs

示例2: Create

		public static void Create(IDesktopWindow desktopWindow, IImageViewer viewer)
		{
			IDisplaySet selectedDisplaySet = viewer.SelectedImageBox.DisplaySet;
			string name = String.Format("{0} - Dynamic TE", selectedDisplaySet.Name);
			IDisplaySet t2DisplaySet = new DisplaySet(name, "");

			double currentSliceLocation = 0.0;

			BackgroundTask task = new BackgroundTask(
				delegate(IBackgroundTaskContext context)
				{
					int i = 0;

					foreach (IPresentationImage image in selectedDisplaySet.PresentationImages)
					{
						IImageSopProvider imageSopProvider = image as IImageSopProvider;

						if (imageSopProvider == null)
							continue;

						ImageSop imageSop = imageSopProvider.ImageSop;
						Frame frame = imageSopProvider.Frame;

						if (frame.SliceLocation != currentSliceLocation)
						{
							currentSliceLocation = frame.SliceLocation;

							try
							{
								DynamicTePresentationImage t2Image = CreateT2Image(imageSop, frame);
								t2DisplaySet.PresentationImages.Add(t2Image);
							}
							catch (Exception e)
							{
								Platform.Log(LogLevel.Error, e);
								desktopWindow.ShowMessageBox("Unable to create T2 series.  Please check the log for details.",
								                             MessageBoxActions.Ok);
								break;
							}

						}

						string message = String.Format("Processing {0} of {1} images", i, selectedDisplaySet.PresentationImages.Count);
						i++;

						BackgroundTaskProgress progress = new BackgroundTaskProgress(i, selectedDisplaySet.PresentationImages.Count, message);
						context.ReportProgress(progress);
					}
				}, false);

			ProgressDialog.Show(task, desktopWindow, true, ProgressBarStyle.Blocks);

			viewer.LogicalWorkspace.ImageSets[0].DisplaySets.Add(t2DisplaySet);
		}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:54,代码来源:DynamicTeSeriesCreator.cs

示例3: CancelOrder

		public static bool CancelOrder(EntityRef orderRef, string description, IDesktopWindow desktopWindow)
		{
			// first check for warnings
			QueryCancelOrderWarningsResponse response = null;
			Platform.GetService<IOrderEntryService>(
				service => response = service.QueryCancelOrderWarnings(new QueryCancelOrderWarningsRequest(orderRef)));

			if (response.Errors != null && response.Errors.Count > 0)
			{
				var error = CollectionUtils.FirstElement(response.Errors);
				desktopWindow.ShowMessageBox(error, MessageBoxActions.Ok);
				return false;
			}

			if (response.Warnings != null && response.Warnings.Count > 0)
			{
				var warn = CollectionUtils.FirstElement(response.Warnings);
				var action = desktopWindow.ShowMessageBox(
					warn + "\n\nAre you sure you want to cancel this order?",
					MessageBoxActions.YesNo);
				if (action == DialogBoxAction.No)
					return false;
			}

			var cancelOrderComponent = new CancelOrderComponent(orderRef);
			var exitCode = ApplicationComponent.LaunchAsDialog(
				desktopWindow,
				cancelOrderComponent,
				String.Format(SR.TitleCancelOrder, description));

			if (exitCode == ApplicationComponentExitCode.Accepted)
			{
				Platform.GetService<IOrderEntryService>(
					service => service.CancelOrder(new CancelOrderRequest(orderRef, cancelOrderComponent.SelectedCancelReason)));

				return true;
			}
			return false;
		}
开发者ID:UIKit0,项目名称:ClearCanvas,代码行数:39,代码来源:OrderCancelHelper.cs

示例4: NeedDialogOnVerify

		/// <summary>
		/// Checks the PD dialog must be shown when verifying the specified worklist item.
		/// </summary>
		/// <param name="worklistItem"></param>
		/// <param name="window"></param>
		/// <returns></returns>
		private static bool NeedDialogOnVerify(WorklistItemSummaryBase worklistItem, IDesktopWindow window)
		{
			var existingConv = ConversationExists(worklistItem.OrderRef);

			// if no existing conversation, may not need to show the dialog
			if (!existingConv)
			{
				// if this is not an emergency order, do not show the dialog
				if (!IsEmergencyOrder(worklistItem.PatientClass.Code))
					return false;

				// otherwise, ask the user if they would like to initiate a PD review
				var msg = string.Format(SR.MessageQueryPrelimDiagnosisReviewRequired, worklistItem.PatientClass.Value);
				var action = window.ShowMessageBox(msg, MessageBoxActions.YesNo);
				if (action == DialogBoxAction.No)
					return false;
			}
			return true;
		}
开发者ID:nhannd,项目名称:Xian,代码行数:25,代码来源:PreliminaryDiagnosis.cs

示例5: CheckIn

		public static bool CheckIn(EntityRef orderRef, string title, IDesktopWindow desktopWindow)
		{
			List<ProcedureSummary> procedures = null;
			Platform.GetService((IRegistrationWorkflowService service) =>
				procedures = service.ListProceduresForCheckIn(new ListProceduresForCheckInRequest(orderRef)).Procedures);

			if(procedures.Count == 0)
			{
				desktopWindow.ShowMessageBox(SR.MessageNoProceduresCanBeCheckedIn, MessageBoxActions.Ok);
				return false;
			}

			var checkInComponent = new CheckInOrderComponent(procedures);
			var exitCode = ApplicationComponent.LaunchAsDialog(
				desktopWindow,
				checkInComponent,
				title);

			return (exitCode == ApplicationComponentExitCode.Accepted);
		}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:20,代码来源:OrderCheckInHelper.cs

示例6: Show

        public static void Show(IDesktopWindow desktopWindow)
        {
            if (_workspace != null)
            {
                _workspace.Activate();
                return;
            }

            if (!PermissionsHelper.IsInRole(AuthorityTokens.ActivityMonitor.View))
            {
                desktopWindow.ShowMessageBox(SR.WarningActivityMonitorPermission, MessageBoxActions.Ok);
                return;
            }

            var component = new ActivityMonitorComponent();
            _workspace = ApplicationComponent.LaunchAsWorkspace(desktopWindow, component, SR.TitleActivityMonitor);
            _workspace.Closed += ((sender, args) =>
            {
                _workspace = null;
            });
        }
开发者ID:nhannd,项目名称:Xian,代码行数:21,代码来源:ActivityMonitorManager.cs

示例7: ApplyCalibration

		private static void ApplyCalibration(double lengthInMm, IPointsGraphic line, Frame frame, IDesktopWindow desktopWindow)
		{
			double aspectRatio;
			
			if (frame.PixelAspectRatio.IsNull)
			{
				// When there is no aspect ratio tag, the image is displayed with the aspect ratio
				// of the pixel spacing, so just keep the aspect ratio the same as
				// what's displayed.  Otherwise, after calibration, a 2cm line drawn horizontally
				// would be visibly different from a 2cm line drawn vertically.
				if (!frame.NormalizedPixelSpacing.IsNull)
					aspectRatio = frame.NormalizedPixelSpacing.AspectRatio;
				else
					aspectRatio = 1;
			}
			else
			{
				aspectRatio = frame.PixelAspectRatio.Value;
			}

			line.CoordinateSystem = CoordinateSystem.Source;
			double widthInPixels = line.Points[1].X - line.Points[0].X;
			double heightInPixels = line.Points[1].Y - line.Points[0].Y;
			line.ResetCoordinateSystem();

			if (widthInPixels == 0 && heightInPixels == 0)
			{
				desktopWindow.ShowMessageBox(SR.ErrorCannotCalibrateZeroLengthRuler, MessageBoxActions.Ok);
				return;
			}

			double pixelSpacingWidth, pixelSpacingHeight;

			CalculatePixelSpacing(
				lengthInMm, 
				widthInPixels, 
				heightInPixels,
				aspectRatio,
				out pixelSpacingWidth,
				out pixelSpacingHeight);

			frame.NormalizedPixelSpacing.Calibrate(pixelSpacingHeight, pixelSpacingWidth);
			line.ParentPresentationImage.Draw();
		}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:44,代码来源:CalibrationTool.cs

示例8: Dump

        private void Dump()
        {
            if (this.ContextBase is IImageViewerToolContext)
            {
                IImageViewerToolContext context = this.ContextBase as IImageViewerToolContext;
                _desktopWindow = context.DesktopWindow;
                IImageSopProvider image = context.Viewer.SelectedPresentationImage as IImageSopProvider;
                if (image == null)
                {                    
                    _desktopWindow.ShowMessageBox(SR.MessagePleaseSelectAnImage, MessageBoxActions.Ok);
                    return;
                }

            	IDicomMessageSopDataSource dataSource = image.ImageSop.DataSource as IDicomMessageSopDataSource;
				if (dataSource == null || dataSource.SourceMessage ==  null)
				{
					 _desktopWindow.ShowMessageBox(SR.MessageUnknownDataSource, MessageBoxActions.Ok);
					return;
				}

                //Fix for Ticket #623 - HH - It turns out that for memory usage optimization the pixel data tag is stripped from the in memory dataset.  
                //So while there are probably many better ways to address the missing pixel data tag a small hack was introduced because this entire utility will 
                //be completely refactored in the very near future to make use of the methods the pacs uses to parse the tags.
                //Addendum to Comment above - HH 07/27/07 - Turns out that our implementation continues to remove the pixel data for optimization at this time so 
                //the workaround is still needed.
				//Addendum to Comment above - JY 09/16/08 - Somewhere along the line, things were changed that made this line redundant - the only reference to
				//it after this point is at +11 lines or so, and all it does is get file.Filename. Therefore, I am commenting this line out.
                //file = new DicomFile(file.Filename);

                if (_component == null)
                {
                    _component = new DicomEditorComponent();
                }
                else
                {
                    _component.Clear();
                }

                _component.Load(dataSource.SourceMessage);
            }
            else if (this.ContextBase is ILocalImageExplorerToolContext)
            {
                ILocalImageExplorerToolContext context = this.ContextBase as ILocalImageExplorerToolContext;
                _desktopWindow = context.DesktopWindow;
                List<string> files = new List<string>();

                if (context.SelectedPaths.Count == 0)
                    return;

                foreach (string rawPath in context.SelectedPaths)
                {
                	if (string.IsNullOrEmpty(rawPath))
                		continue;

                    FileProcessor.Process(rawPath, "*.*", files.Add, true);
                }

                if (files.Count == 0)
                {
                    context.DesktopWindow.ShowMessageBox(SR.MessageNoFilesSelected, MessageBoxActions.Ok);
                    return;
                }

                if (_component == null)
                {
                    _component = new DicomEditorComponent();
                }
                else
                {
                    _component.Clear();
                }

                bool userCancelled = false;

                BackgroundTask task = new BackgroundTask(delegate(IBackgroundTaskContext backgroundcontext)
                {
                    int i = 0;

                    foreach (string file in files)
                    {
                        if (backgroundcontext.CancelRequested)
                        {
                            backgroundcontext.Cancel();
                            userCancelled = true;
                            return;
                        }
                        try
                        {
                            _component.Load(file);
                        }
                        catch (DicomException e)
                        {
                            backgroundcontext.Error(e);
                            return;
                        }
                        backgroundcontext.ReportProgress(new BackgroundTaskProgress((int)(((double)(i + 1) / (double)files.Count) * 100.0), SR.MessageDumpProgressBar));
                        i++;
                    }

                    backgroundcontext.Complete(null);
//.........这里部分代码省略.........
开发者ID:nhannd,项目名称:Xian,代码行数:101,代码来源:ShowDicomEditorTool.cs


注:本文中的IDesktopWindow.ShowMessageBox方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。