コード例 #1
0
        protected EntityRef GetSupervisorRef()
        {
            ProtocollingSupervisorSelectionComponent component = new ProtocollingSupervisorSelectionComponent();

            if (ApplicationComponentExitCode.Accepted == ApplicationComponent.LaunchAsDialog(this.Context.DesktopWindow, component, SR.TitleSelectSupervisor))
            {
                return(component.Staff != null ? component.Staff.StaffRef : null);
            }
            else
            {
                return(null);
            }
        }
コード例 #2
0
        protected EntityRef GetSupervisorRef()
        {
            var supervisorSelectionComponent = new ReportingSupervisorSelectionComponent();
            var supervisorSelected           = ApplicationComponentExitCode.Accepted
                                               == ApplicationComponent.LaunchAsDialog(this.Context.DesktopWindow, supervisorSelectionComponent, SR.TitleSelectSupervisor);

            if (!supervisorSelected)
            {
                return(null);
            }

            return(supervisorSelectionComponent.Staff != null ? supervisorSelectionComponent.Staff.StaffRef : null);
        }
コード例 #3
0
 public void Show()
 {
     if (_shelf == null)
     {
         _shelf         = ApplicationComponent.LaunchAsShelf(_desktopWindow, _progressDialog, "Dicom打印", ShelfDisplayHint.DockAutoHide | ShelfDisplayHint.DockBottom);
         _shelf.Closed += ShelfClose;
         _shelf.Activate();
     }
     else
     {
         _shelf.Activate();
     }
 }
コード例 #4
0
        private AEInformation get_server()
        {
            ServerTreeComponent serverTreeComponent = new ServerTreeComponent();

            serverTreeComponent.IsReadOnly             = false;
            serverTreeComponent.ShowCheckBoxes         = false;
            serverTreeComponent.ShowLocalDataStoreNode = true;
            serverTreeComponent.ShowTitlebar           = true;
            serverTreeComponent.ShowTools = true;

            SimpleComponentContainer dialogContainer = new SimpleComponentContainer(serverTreeComponent);

            ApplicationComponentExitCode code =
                ApplicationComponent.LaunchAsDialog(
                    this.Context.DesktopWindow,
                    dialogContainer,
                    "Choose Server");

            if (code == ApplicationComponentExitCode.Accepted)
            {
                if (serverTreeComponent.SelectedServers.IsLocalDatastore == true)
                {
                    this.Context.DesktopWindow.ShowMessageBox("Cannot send to 'My Studies'", MessageBoxActions.Ok);
                    return(null);
                }
                if (serverTreeComponent.SelectedServers == null || serverTreeComponent.SelectedServers.Servers == null || serverTreeComponent.SelectedServers.Servers.Count == 0)
                {
                    this.Context.DesktopWindow.ShowMessageBox("Invalid selection", MessageBoxActions.Ok);
                    return(null);
                }

                if (serverTreeComponent.SelectedServers.Servers.Count > 1)
                {
                    this.Context.DesktopWindow.ShowMessageBox("Cannot select multiple servers", MessageBoxActions.Ok);
                    return(null);
                }

                Server selected_server = (Server)serverTreeComponent.SelectedServers.Servers[0];

                AEInformation destination = new AEInformation();
                destination.AETitle  = selected_server.AETitle;
                destination.HostName = selected_server.Host;
                destination.Port     = selected_server.Port;

                return(destination);
            }
            else
            {
                return(null);
            }
        }
コード例 #5
0
        /// <summary>
        /// Called to handle the "add" action.
        /// </summary>
        /// <param name="addedItems"></param>
        /// <returns>True if items were added, false otherwise.</returns>
        protected override bool AddItems(out IList <PatientNoteCategorySummary> addedItems)
        {
            addedItems = new List <PatientNoteCategorySummary>();
            NoteCategoryEditorComponent  editor   = new NoteCategoryEditorComponent();
            ApplicationComponentExitCode exitCode = ApplicationComponent.LaunchAsDialog(
                this.Host.DesktopWindow, editor, SR.TitleAddNoteCategory);

            if (exitCode == ApplicationComponentExitCode.Accepted)
            {
                addedItems.Add(editor.NoteCategorySummary);
                return(true);
            }
            return(false);
        }
コード例 #6
0
        public void Apply()
        {
            var item = (ExternalPractitionerSummary)this.Context.Selection.Item;

            var editor   = new ExternalPractitionerEditorComponent(item.PractitionerRef);
            var exitCode = ApplicationComponent.LaunchAsDialog(
                this.Context.DesktopWindow, editor, SR.TitleUpdateExternalPractitioner + " - " + Formatting.PersonNameFormat.Format(item.Name));

            if (exitCode == ApplicationComponentExitCode.Accepted)
            {
                DocumentManager.InvalidateFolder(typeof(UnverifiedFolder));
                DocumentManager.InvalidateFolder(typeof(VerifiedTodayFolder));
            }
        }
コード例 #7
0
        internal static Shelf Launch(IDesktopWindow window)
        {
            var component = new PrintImageViewerComponent(window);

            _printViewImageViewer = component;
            var shelf = ApplicationComponent.LaunchAsShelf(
                window,
                component,
                "打印预览",
                ShelfDisplayHint.DockRight
                );

            return(shelf);
        }
コード例 #8
0
        /// <summary>
        /// Called to handle the "add" action.
        /// </summary>
        /// <param name="addedItems"></param>
        /// <returns>True if items were added, false otherwise.</returns>
        protected override bool AddItems(out IList <DiagnosticServiceSummary> addedItems)
        {
            addedItems = new List <DiagnosticServiceSummary>();
            DiagnosticServiceEditorComponent editor   = new DiagnosticServiceEditorComponent();
            ApplicationComponentExitCode     exitCode = ApplicationComponent.LaunchAsDialog(
                this.Host.DesktopWindow, editor, SR.TitleAddDiagnosticService);

            if (exitCode == ApplicationComponentExitCode.Accepted)
            {
                addedItems.Add(editor.DiagnosticServiceSummary);
                return(true);
            }
            return(false);
        }
コード例 #9
0
 public void ApplicationComponentDoubleClicked()
 {
     try
     {
         ApplicationComponentExitCode exitCode = ApplicationComponent.LaunchAsDialog(
             this.Host.DesktopWindow,
             new ValidationEditorComponent(_selectedComponent),
             string.Format("{0} Rules Editor", _selectedComponent.Name));
     }
     catch (Exception e)
     {
         ExceptionHandler.Report(e, this.Host.DesktopWindow);
     }
 }
コード例 #10
0
 public void Show()
 {
     if (_shelf != null)
     {
         _shelf.Activate();
     }
     else
     {
         MemoryAnalysisComponent component = new MemoryAnalysisComponent(this.Context.DesktopWindow);
         _shelf = ApplicationComponent.LaunchAsShelf(this.Context.DesktopWindow, component, "Memory Analysis",
                                                     ShelfDisplayHint.DockFloat);
         _shelf.Closed += delegate { _shelf = null; };
     }
 }
コード例 #11
0
        public void Apply()
        {
            if (_shelf != null)
            {
                _shelf.Activate();
                return;
            }

            PerformanceAnalysisComponent component = new PerformanceAnalysisComponent();

            _shelf = ApplicationComponent.LaunchAsShelf(this.Context.DesktopWindow, component, "Performance Analysis",
                                                        ShelfDisplayHint.DockFloat);

            _shelf.Closing += delegate { _shelf = null; };
        }
コード例 #12
0
        public void OpenAnalysisTool()
        {
            if (_shelf != null)
            {
                _shelf.Activate();
            }
            else
            {
                StreamingAnalysisComponent component = new StreamingAnalysisComponent(base.Context);
                _shelf = ApplicationComponent.LaunchAsShelf(base.Context.DesktopWindow, component,
                                                            "Streaming Analysis", ShelfDisplayHint.DockFloat | ShelfDisplayHint.ShowNearMouse);

                _shelf.Closed += delegate { _shelf = null; };
            }
        }
コード例 #13
0
        private void details(StringBuilder sb, ApplicationComponent cmp, string param, string value)
        {
            if (param.IsNotNullOrWhiteSpace())
            {
                sb.AppendLine("<f color=gray>Trying to set parameter <f color=yellow>'{0}'<f color=gray> to value  <f color=cyan>'{1}'".Args(param, value ?? "<null>"));
                if (!ExternalParameterAttribute.SetParameter(cmp.App, cmp, param, value))
                {
                    sb.AppendLine("<f color=red>Parameter <f color=yellow>'{0}'<f color=red> set did NOT SUCCEED".Args(param));
                    return;
                }
                sb.AppendLine("<f color=green>Parameter <f color=yellow>'{0}'<f color=green> set SUCCEEDED".Args(param));
                sb.AppendLine();
            }

            dumpDetails(sb, cmp, 0);
        }
コード例 #14
0
 public void Show()
 {
     if (_shelves.ContainsKey(base.Context.DesktopWindow))
     {
         _shelves[base.Context.DesktopWindow].Activate();
     }
     else
     {
         this._window = base.Context.DesktopWindow;
         //IClientSetting clientSetting = new ClientSettingExtensionPoint().CreateExtension() as IClientSetting;
         PrintToolComponent component = new PrintToolComponent(this._window);
         IShelf             shelf     = ApplicationComponent.LaunchAsShelf(this._window, component, SR.Name, SR.Title, ShelfDisplayHint.DockAutoHide | ShelfDisplayHint.DockLeft);
         _shelves[this._window]         = shelf;
         _shelves[this._window].Closed += new EventHandler <ClosedEventArgs>(this.OnShelfClosed);
     }
 }
コード例 #15
0
 public void Open()
 {
     if (_shelf == null)
     {
         _shelf = ApplicationComponent.LaunchAsShelf(
             this.Context.DesktopWindow,
             new TagBrowserComponent(new TagDatabase()),
             "Study Tagging",
             ShelfDisplayHint.DockRight);
         _shelf.Closed += delegate { _shelf = null; };
     }
     else
     {
         _shelf.Activate();
     }
 }
コード例 #16
0
        /// <summary>
        /// Called to handle the "edit" action.
        /// </summary>
        /// <param name="items">A list of items to edit.</param>
        /// <param name="editedItems">The list of items that were edited.</param>
        /// <returns>True if items were edited, false otherwise.</returns>
        protected override bool EditItems(IList <ProcedureTypeSummary> items, out IList <ProcedureTypeSummary> editedItems)
        {
            editedItems = new List <ProcedureTypeSummary>();
            ProcedureTypeSummary item = CollectionUtils.FirstElement(items);

            ProcedureTypeEditorComponent editor   = new ProcedureTypeEditorComponent(item.ProcedureTypeRef);
            ApplicationComponentExitCode exitCode = ApplicationComponent.LaunchAsDialog(
                this.Host.DesktopWindow, editor, SR.TitleUpdateProcedureType + " - " + "(" + item.Id + ") " + item.Name);

            if (exitCode == ApplicationComponentExitCode.Accepted)
            {
                editedItems.Add(editor.ProcedureTypeSummary);
                return(true);
            }
            return(false);
        }
コード例 #17
0
        /// <summary>
        /// Called to handle the "edit" action.
        /// </summary>
        /// <param name="items">A list of items to edit.</param>
        /// <param name="editedItems">The list of items that were edited.</param>
        /// <returns>True if items were edited, false otherwise.</returns>
        protected override bool EditItems(IList <ModalitySummary> items, out IList <ModalitySummary> editedItems)
        {
            editedItems = new List <ModalitySummary>();
            ModalitySummary item = CollectionUtils.FirstElement(items);

            ModalityEditorComponent      editor   = new ModalityEditorComponent(item.ModalityRef);
            ApplicationComponentExitCode exitCode = ApplicationComponent.LaunchAsDialog(
                this.Host.DesktopWindow, editor, string.Format(SR.FormatTitleCodeSubtitle, SR.TitleUpdateModality, item.Id, item.Name));

            if (exitCode == ApplicationComponentExitCode.Accepted)
            {
                editedItems.Add(editor.ModalitySummary);
                return(true);
            }
            return(false);
        }
コード例 #18
0
        /// <summary>
        /// Called to handle the "edit" action.
        /// </summary>
        /// <param name="items">A list of items to edit.</param>
        /// <param name="editedItems">The list of items that were edited.</param>
        /// <returns>True if items were edited, false otherwise.</returns>
        protected override bool EditItems(IList <PatientNoteCategorySummary> items, out IList <PatientNoteCategorySummary> editedItems)
        {
            editedItems = new List <PatientNoteCategorySummary>();
            PatientNoteCategorySummary item = CollectionUtils.FirstElement(items);

            NoteCategoryEditorComponent  editor   = new NoteCategoryEditorComponent(item.NoteCategoryRef);
            ApplicationComponentExitCode exitCode = ApplicationComponent.LaunchAsDialog(
                this.Host.DesktopWindow, editor, SR.TitleUpdateNoteCategory + " - " + item.Name);

            if (exitCode == ApplicationComponentExitCode.Accepted)
            {
                editedItems.Add(editor.NoteCategorySummary);
                return(true);
            }
            return(false);
        }
コード例 #19
0
        bool ILookupHandler.Resolve(string query, bool interactive, out object result)
        {
            result = null;

            var userComponent = new UserSummaryComponent(true);
            var exitCode      = ApplicationComponent.LaunchAsDialog(
                _desktopWindow, userComponent, SR.TitleUser);

            if (exitCode == ApplicationComponentExitCode.Accepted)
            {
                var summary = (UserSummary)userComponent.SummarySelection.Item;
                result = new UserLookupData(summary.UserName);
            }

            return(result != null);
        }
コード例 #20
0
        /// <summary>
        /// Shows all <see cref="IConfigurationPage"/>s returned by extensions of
        /// <see cref="SharedConfigurationPageProviderExtensionPoint"/>
        /// in a dialog, with a navigable tree to select the pages.
        /// </summary>
        public static ApplicationComponentExitCode Show(IDesktopWindow desktopWindow, string initialPageIdentifier)
        {
            var pages = GetPages();

            if (pages.Count == 0)
            {
                //There are pages in this plugin, so this is the most likely reason, although I suppose not the only one.
                desktopWindow.ShowMessageBox(SR.MessageSystemConfigurationNoPermission, MessageBoxActions.Ok);
                return(ApplicationComponentExitCode.None);
            }

            var container = new ConfigurationDialogComponent(pages, initialPageIdentifier);
            var exitCode  = ApplicationComponent.LaunchAsDialog(desktopWindow, container, SR.TitleSharedConfiguration);

            return(exitCode);
        }
コード例 #21
0
        /// <summary>
        /// Called to handle the "edit" action.
        /// </summary>
        /// <param name="items">A list of items to edit.</param>
        /// <param name="editedItems">The list of items that were edited.</param>
        /// <returns>True if items were edited, false otherwise.</returns>
        protected override bool EditItems(IList <ProtocolCodeSummary> items, out IList <ProtocolCodeSummary> editedItems)
        {
            editedItems = new List <ProtocolCodeSummary>();
            ProtocolCodeSummary item = CollectionUtils.FirstElement(items);

            ProtocolCodeEditorComponent  editor   = new ProtocolCodeEditorComponent(item.ProtocolCodeRef);
            ApplicationComponentExitCode exitCode = ApplicationComponent.LaunchAsDialog(
                this.Host.DesktopWindow, editor, string.Format("Update code '{0}'", item.Name));

            if (exitCode == ApplicationComponentExitCode.Accepted)
            {
                editedItems.Add(editor.ProtocolCode);
                return(true);
            }
            return(false);
        }
コード例 #22
0
        /// <summary>
        /// Called by the framework when the user clicks the "apply" menu item or toolbar button.
        /// </summary>
        public void Apply()
        {
            // TODO
            // Add code here to implement the functionality of the tool
            // If this tool is associated with a workspace, you can access the workspace
            // using the Workspace property

            ApplicationComponent.LaunchAsShelf(
                this.Context.DesktopWindow,
                new ShredHostClientComponent(),
                "ShredHost Client UI",
                ShelfDisplayHint.DockLeft,
                delegate(IApplicationComponent component)
                { Console.WriteLine("Done!"); }
                );
        }
コード例 #23
0
        private bool ResolveNameInteractive(string query, out CannedText result)
        {
            result = null;

            var cannedTextComponent = new CannedTextSummaryComponent(true, query);
            var exitCode            = ApplicationComponent.LaunchAsDialog(
                _desktopWindow, cannedTextComponent, SR.TitleCannedText);

            if (exitCode == ApplicationComponentExitCode.Accepted)
            {
                var summary = (CannedTextSummary)cannedTextComponent.SummarySelection.Item;
                result = new CannedText(summary);
            }

            return(result != null);
        }
コード例 #24
0
        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));
            }
        }
コード例 #25
0
        public override bool ResolveNameInteractive(string query, out StaffGroupSummary result)
        {
            result = null;

            var staffComponent = new StaffGroupSummaryComponent(true, query, _electiveGroupsOnly);

            staffComponent.IncludeDeactivatedItems = this.IncludeDeactivatedItems;
            var exitCode = ApplicationComponent.LaunchAsDialog(
                _desktopWindow, staffComponent, SR.TitleStaffGroups);

            if (exitCode == ApplicationComponentExitCode.Accepted)
            {
                result = (StaffGroupSummary)CollectionUtils.FirstElement(staffComponent.SummarySelection.Items);
            }

            return(result != null);
        }
コード例 #26
0
        public void Apply()
        {
            try
            {
                var title = string.Format(SR.FormatPrintReport, Formatting.AccessionFormat.Format(this.Context.AccessionNumber));

                var component = new PrintReportComponent(this.Context.OrderRef, this.Context.ReportRef);
                ApplicationComponent.LaunchAsDialog(
                    this.Context.DesktopWindow,
                    component,
                    title);
            }
            catch (Exception e)
            {
                ExceptionHandler.Report(e, this.Context.DesktopWindow);
            }
        }
コード例 #27
0
        private bool doCall(StringBuilder sb, ApplicationComponent cmp, IConfigSectionNode call, bool isHelp)
        {
            var callable = cmp as IExternallyCallable;

            if (callable == null)
            {
                sb.AppendFormat("<f color=red>This component is not IExternallyCallable\n");
                return(false);
            }

            var handler = callable.GetExternalCallHandler();

            if (isHelp)
            {
                foreach (var type in handler.SupportedRequestTypes)
                {
                    var response = handler.DescribeRequest(type);
                    sb.AppendFormat("<f color=white>{0}\n", type.Name);
                    sb.AppendFormat("<f color=gray>{0}\n\n", response.Content);
                }
                return(true);
            }

            var any = false;

            foreach (var request in call.Children)
            {
                var response = handler.HandleRequest(request);

                if (response == null)
                {
                    sb.AppendFormat("<f color=red>Call request `{0}` was not handled \n".Args(request.RootPath));
                    return(false);
                }
                any = true;

                sb.AppendFormat("@`{0}` | Status: {1} / {2}\n", request.RootPath, response.StatusCode, response.StatusDescription);
                sb.AppendFormat("Content type: {0}\n", response.ContentType);
                sb.AppendFormat("Content: \n");
                sb.Append(response.Content);
                sb.AppendLine();
                sb.AppendLine();
            }

            return(any);
        }
コード例 #28
0
        public void Launch()
        {
            try
            {
                var component = new DowntimePrintFormsComponent();

                ApplicationComponent.LaunchAsDialog(
                    this.Context.DesktopWindow,
                    component,
                    SR.TitlePrintDowntimeForms);
            }
            catch (Exception e)
            {
                // could not launch component
                ExceptionHandler.Report(e, this.Context.DesktopWindow);
            }
        }
コード例 #29
0
        private bool Edit(EntityRef profileRef, IDesktopWindow desktopWindow)
        {
            try
            {
                ApplicationComponentExitCode exitCode = ApplicationComponent.LaunchAsDialog(
                    desktopWindow,
                    new PatientProfileEditorComponent(profileRef),
                    SR.TitleEditPatient);

                return(exitCode == ApplicationComponentExitCode.Accepted);
            }
            catch (Exception e)
            {
                ExceptionHandler.Report(e, desktopWindow);
                return(false);
            }
        }
コード例 #30
0
        protected override bool Execute(ReportingWorklistItemSummary item)
        {
            try
            {
                ApplicationComponentExitCode exitCode = ApplicationComponent.LaunchAsDialog(
                    this.Context.DesktopWindow,
                    new ReassignComponent(item),
                    SR.TitleReassignItem);

                return(exitCode == ApplicationComponentExitCode.Accepted);
            }
            catch (Exception e)
            {
                ExceptionHandler.Report(e, this.Context.DesktopWindow);
                return(false);
            }
        }