示例#1
0
        protected bool ExecuteCore(WorklistItemSummaryBase item)
        {
            var list      = new List <TItem>(this.Context.SelectedItems);
            var orderRefs = CollectionUtils.Map <TItem, EntityRef>(list, x => x.OrderRef);
            var component = new MergeOrdersComponent(orderRefs);

            string failureReason;

            if (!ValidateMergeRequest(orderRefs, out failureReason))
            {
                this.Context.DesktopWindow.ShowMessageBox(failureReason, MessageBoxActions.Ok);
                return(false);
            }

            var args = new DialogBoxCreationArgs(component, SR.TitleMergeOrders, null)
            {
                AllowUserResize = true
            };

            if (ApplicationComponentExitCode.Accepted != ApplicationComponent.LaunchAsDialog(this.Context.DesktopWindow, args))
            {
                return(false);
            }

            InvalidateFolders();

            return(true);
        }
        private void MergePractitioners()
        {
            try
            {
                var firstItem  = CollectionUtils.FirstElement(this.SelectedItems);
                var secondItem = this.SelectedItems.Count > 1 ? CollectionUtils.LastElement(this.SelectedItems) : null;

                if (firstItem != null && !CanMerge(firstItem) ||
                    secondItem != null && !CanMerge(secondItem))
                {
                    this.Host.ShowMessageBox(SR.MessageCannotMergeSelectedPractitioners, MessageBoxActions.Ok);
                    return;
                }

                var editor = new ExternalPractitionerMergeNavigatorComponent(firstItem.PractitionerRef, secondItem == null ? null : secondItem.PractitionerRef);

                var title       = SR.TitleMergePractitioner + " - " + Formatting.PersonNameFormat.Format(firstItem.Name);
                var creationArg = new DialogBoxCreationArgs(editor, title, null, DialogSizeHint.Large);

                LaunchAsDialog(this.Host.DesktopWindow, creationArg);
            }
            catch (Exception e)
            {
                // failed to launch editor
                ExceptionHandler.Report(e, this.Host.DesktopWindow);
            }
        }
        private static DialogBoxCreationArgs CreateArgs()
        {
            DialogBoxCreationArgs args = new DialogBoxCreationArgs();

            args.Component = new DummyComponent();
            args.SizeHint  = DialogSizeHint.Auto;
            return(args);
        }
 public void Configure()
 {
     try
     {
         var component = new ActionModelsToolComponent();
         var args      = new DialogBoxCreationArgs(component, "Action Model Configurator", "actionModelConfiugrator", true);
         Context.DesktopWindow.ShowDialogBox(args);
     }
     catch (Exception ex)
     {
         ExceptionHandler.Report(ex, Context.DesktopWindow);
     }
 }
        public void Apply()
        {
            var firstItem  = CollectionUtils.FirstElement(this.Context.SelectedItems);
            var secondItem = this.Context.SelectedItems.Count > 1 ? CollectionUtils.LastElement(this.Context.SelectedItems) : null;
            var editor     = new ExternalPractitionerMergeNavigatorComponent(firstItem.PractitionerRef, secondItem == null ? null : secondItem.PractitionerRef);

            var title       = SR.TitleMergePractitioner + " - " + Formatting.PersonNameFormat.Format(firstItem.Name);
            var creationArg = new DialogBoxCreationArgs(editor, title, null, DialogSizeHint.Large);

            var exitCode = ApplicationComponent.LaunchAsDialog(this.Context.DesktopWindow, creationArg);

            if (exitCode == ApplicationComponentExitCode.Accepted)
            {
                DocumentManager.InvalidateFolder(typeof(UnverifiedFolder));
            }
        }
        public void Customize()
        {
            try
            {
                if (SettingsStore.IsSupported && !SettingsStore.IsStoreOnline)
                {
                    base.Context.DesktopWindow.ShowMessageBox(Desktop.SR.MessageSettingsStoreOffline, MessageBoxActions.Ok);
                    return;
                }

                CustomizeViewerActionModelsComponent component = new CustomizeViewerActionModelsComponent(this.ImageViewer);

                DialogBoxCreationArgs args = new DialogBoxCreationArgs(component, SR.TitleCustomizeActionModels, "CustomizeActionModels")
                {
                    AllowUserResize = true
                };
                ApplicationComponent.LaunchAsDialog(this.Context.DesktopWindow, args);
            }
            catch (Exception ex)
            {
                ExceptionHandler.Report(ex, SR.MessageActionModelUpdateFailure, Context.DesktopWindow);
            }
        }