public void Show()
        {
            // check if a layout component is already displayed
            if (_shelves.ContainsKey(Context.DesktopWindow))
            {
                _shelves[Context.DesktopWindow].Activate();
            }
            else
            {
                BlockingOperation.Run(delegate
                {
                    _desktopWindow = Context.DesktopWindow;

                    var component =
                        new SegmentationComponent(Context.DesktopWindow);

                    IShelf shelf = ApplicationComponent.LaunchAsShelf(
                        _desktopWindow,
                        component,
                        SR.SegmentationTitle,
                        "DICOM Segmentation",
                        ShelfDisplayHint.DockRight | ShelfDisplayHint.DockAutoHide);

                    shelf.Closed            += OnShelfClosed;
                    _shelves[_desktopWindow] = shelf;
                });
            }
        }
Beispiel #2
0
        public void Show()
        {
            if (ComponentShelf == null)
            {
                try
                {
                    IDesktopWindow desktopWindow = Context.DesktopWindow;

                    ImagePropertiesApplicationComponent component =
                        new ImagePropertiesApplicationComponent(Context.DesktopWindow);

                    IShelf shelf = ApplicationComponent.LaunchAsShelf(Context.DesktopWindow, component,
                                                                      SR.TitleImageProperties, "ImageProperties", ShelfDisplayHint.DockLeft);

                    Shelves.Add(Context.DesktopWindow, shelf);
                    shelf.Closed += delegate { Shelves.Remove(desktopWindow); };
                }
                catch (Exception e)
                {
                    ExceptionHandler.Report(e, Context.DesktopWindow);
                }
            }
            else
            {
                ComponentShelf.Show();
            }
        }
Beispiel #3
0
        public void Launch()
        {
            try
            {
                if (_shelf == null)
                {
                    var component = new CannedTextSummaryComponent();

                    _shelf = ApplicationComponent.LaunchAsShelf(
                        this.Context.DesktopWindow,
                        component,
                        SR.TitleCannedText,
                        SR.TitleCannedText,
                        ShelfDisplayHint.DockFloat);

                    _shelf.Closed += delegate { _shelf = null; };
                }
                else
                {
                    _shelf.Activate();
                }
            }
            catch (Exception e)
            {
                // could not launch component
                ExceptionHandler.Report(e, this.Context.DesktopWindow);
            }
        }
Beispiel #4
0
        public void Show()
        {
            CommandHistoryComponent component = new CommandHistoryComponent();

            component.TargetWorkspace = base.Context.DesktopWindow.ActiveWorkspace;
            ApplicationComponent.LaunchAsShelf(base.Context.DesktopWindow, component, SR.szCommandHistoryInspector, ShelfDisplayHint.DockLeft);
        }
        public void Show()
        {
            // check if a layout component is already displayed
            if (_shelves.ContainsKey(this.Context.DesktopWindow))
            {
                _shelves[this.Context.DesktopWindow].Activate();
            }
            else
            {
                BlockingOperation.Run(delegate
                {
                    _desktopWindow = this.Context.DesktopWindow;

                    AimAnnotationComponent aimComponent = AimAnnotationComponent.Create(Context.DesktopWindow, false);

                    IShelf shelf = ApplicationComponent.LaunchAsShelf(
                        _desktopWindow,
                        aimComponent,
                        SR.TitleAIMCreater,
                        "AIM Annotation",
                        ShelfDisplayHint.DockRight | ShelfDisplayHint.DockAutoHide);

                    shelf.Closed            += OnShelfClosed;
                    _shelves[_desktopWindow] = shelf;
                });
            }
        }
Beispiel #6
0
        private void Export()
        {
            if (DisplaySet.PresentationImages.Count <= 10)
            {
                ExportImages(null);
                Cleanup();
            }
            else
            {
                BackgroundTask task = new BackgroundTask(ExportImages, true)
                {
                    ThreadUICulture = Application.CurrentUICulture
                };

                _clipboardItem.Lock();

                ProgressDialogComponent progressComponent = new ProgressDialogComponent(task, true, ProgressBarStyle.Blocks);
                _progressComponentShelf = ApplicationComponent.LaunchAsShelf(this.Host.DesktopWindow,
                                                                             progressComponent,
                                                                             SR.TitleCreatingVideo, "CreatingVideo",
                                                                             ShelfDisplayHint.DockFloat);

                _progressComponentShelf.Closed +=
                    delegate
                {
                    _clipboardItem.Unlock();
                    Cleanup();
                    task.Dispose();
                };
            }
        }
Beispiel #7
0
        public static void Show(IDesktopWindow desktopWindow, ShelfDisplayHint displayHint)
        {
            // TODO (CR Phoenix5 - Med): Clinical as well
            if (!PermissionsHelper.IsInRole(AuthorityTokens.KeyImages))
            {
                throw new PolicyException(SR.ExceptionViewKeyImagePermissionDenied);
            }

            desktopWindow = desktopWindow ?? Application.ActiveDesktopWindow;

            IShelf shelf = GetClipboardShelf(desktopWindow);

            if (shelf != null)
            {
                shelf.Activate();
            }
            else
            {
                Workspace           activeWorkspace = desktopWindow.ActiveWorkspace;
                KeyImageInformation info            = GetKeyImageInformation(activeWorkspace) ?? new KeyImageInformation();
                ClipboardComponent  component       = new KeyImageClipboardComponent(info);
                shelf         = ApplicationComponent.LaunchAsShelf(desktopWindow, component, SR.TitleKeyImages, displayHint);
                shelf.Closed += OnClipboardShelfClosed;

                ClipboardShelves[desktopWindow] = shelf;
            }
        }
Beispiel #8
0
        private static void LaunchShelf(IDesktopWindow desktopWindow, IApplicationComponent component, ShelfDisplayHint shelfDisplayHint)
        {
            IShelf shelf = ApplicationComponent.LaunchAsShelf(desktopWindow, component, SR.TitleCine, "Cine", shelfDisplayHint);

            Shelves[desktopWindow]         = shelf;
            Shelves[desktopWindow].Closed += OnShelfClosed;
        }
Beispiel #9
0
        public static void Show(IDesktopWindow desktopWindow, ShelfDisplayHint displayHint)
        {
            if (!KeyImageClipboardComponent.HasViewPlugin)
            {
                return;
            }

            if (!PermissionsHelper.IsInRole(AuthorityTokens.Study.KeyImages))
            {
                throw new PolicyException(SR.ExceptionViewKeyImagePermissionDenied);
            }

            desktopWindow = desktopWindow ?? Application.ActiveDesktopWindow;

            IShelf shelf = GetClipboardShelf(desktopWindow);

            if (shelf != null)
            {
                shelf.Activate();
            }
            else
            {
                Workspace          activeWorkspace = desktopWindow.ActiveWorkspace;
                var                info            = GetKeyImageClipboard(activeWorkspace);
                ClipboardComponent component       = new KeyImageClipboardComponent(info);
                shelf         = ApplicationComponent.LaunchAsShelf(desktopWindow, component, SR.TitleKeyImages, displayHint);
                shelf.Closed += OnClipboardShelfClosed;

                ClipboardShelves[desktopWindow] = shelf;
            }
        }
        public void Launch()
        {
            if (_shelf == null)
            {
                try
                {
                    ValidationEditorComponent editor = new ValidationEditorComponent(this.Context.Component);

                    _shelf = ApplicationComponent.LaunchAsShelf(
                        this.Context.DesktopWindow,
                        editor,
                        string.Format("{0} rules editor", this.Context.Component.GetType().Name),
                        ShelfDisplayHint.DockFloat);
                    _shelf.Closed += delegate { _shelf = null; };
                }
                catch (Exception e)
                {
                    // could not launch component
                    ExceptionHandler.Report(e, this.Context.DesktopWindow);
                }
            }
            else
            {
                _shelf.Activate();
            }
        }
Beispiel #11
0
        private void ShowInternal()
        {
            if (_desktopObject != null)
            {
                _desktopObject.Activate();
                return;
            }

            List <TabPage> pages = new List <TabPage>();

            foreach (IHealthcareArtifactExplorer explorer in GetExplorers())
            {
                IApplicationComponent component = explorer.Component;
                if (component != null)
                {
                    pages.Add(new TabPage(explorer.Name, component));
                }
            }

            if (pages.Count == 0)
            {
                return;
            }

            TabComponentContainer container = new TabComponentContainer();

            foreach (TabPage page in pages)
            {
                container.Pages.Add(page);
            }

            if (LaunchAsShelf)
            {
                ShelfCreationArgs args = new ShelfCreationArgs();
                args.Component   = container;
                args.Title       = SR.TitleExplorer;
                args.Name        = "Explorer";
                args.DisplayHint = ShelfDisplayHint.DockLeft | ShelfDisplayHint.DockAutoHide;

                _desktopObject = ApplicationComponent.LaunchAsShelf(this.Context.DesktopWindow, args);
            }
            else
            {
                WorkspaceCreationArgs args = new WorkspaceCreationArgs();
                args.Component    = container;
                args.Title        = SR.TitleExplorer;
                args.Name         = "Explorer";
                args.UserClosable = IsWorkspaceClosable;

                _desktopObject = ApplicationComponent.LaunchAsWorkspace(this.Context.DesktopWindow, args);
            }

            _desktopObject.Closed += delegate { _desktopObject = null; };
        }
Beispiel #12
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();
     }
 }
        internal static Shelf Launch(IDesktopWindow window)
        {
            var component = new PrintImageViewerComponent(window);

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

            return(shelf);
        }
Beispiel #14
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; };
     }
 }
Beispiel #15
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; };
        }
Beispiel #16
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; };
            }
        }
Beispiel #17
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);
     }
 }
Beispiel #18
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!"); }
                );
        }
 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();
     }
 }
        public void Show()
        {
            if (_volumeComponent == null)
            {
                // create and initialize the layout component
                _volumeComponent = new VolumeComponent(this.Context.DesktopWindow);

                // launch the layout component in a shelf
                _volumeShelf = ApplicationComponent.LaunchAsShelf(
                    this.Context.DesktopWindow,
                    _volumeComponent,
                    SR.TitleVolumeController,
                    ShelfDisplayHint.DockLeft);

                _volumeShelf.Closed += VolumeShelf_Closed;
            }
        }
Beispiel #21
0
        // Note: you may change the name of the 'Apply' method as desired, but be sure to change the
        // corresponding parameter in the MenuAction and ButtonAction attributes

        /// <summary>
        /// Called by the framework when the user clicks the "apply" menu item or toolbar button.
        /// </summary>
        public void Apply()
        {
            _component = new DicomEditorComponent();

            // Loop through all selected studies
            foreach (StudyItem selectedstudy in this.Context.SelectedStudies)
            {
                string studyUID     = selectedstudy.StudyInstanceUid;
                int    numberOfSops = LocalStudyLoader.Start(new StudyLoaderArgs(studyUID, null));

                // Loop through all images in study
                for (int i = 0; i < numberOfSops; ++i)
                {
                    Sop imageSop = LocalStudyLoader.LoadNextSop();
                    ILocalSopDataSource localsource = (ILocalSopDataSource)imageSop.DataSource;
                    // Load images into dicom editor
                    _component.Load(localsource.SourceMessage);
                    // Keep track of file paths for later re-importation
                    _filePaths.Add(localsource.Filename);
                }
                // This code deletes the study from the database, so that when it is re-imported the changed fields
                // will appear
                using (IDataStoreStudyRemover studyRemover = DataAccessLayer.GetIDataStoreStudyRemover())
                {
                    studyRemover.RemoveStudy(selectedstudy.StudyInstanceUid);
                }
            }
            // Launch Dicom Editor Shelf
            if (_shelf != null)
            {
                _shelf.Activate();
            }
            else
            {
                _shelf = ApplicationComponent.LaunchAsShelf(
                    this.Context.DesktopWindow,
                    _component,
                    "Dicom Editor",
                    "Dicom Editor",
                    ShelfDisplayHint.DockRight | ShelfDisplayHint.DockAutoHide);
                _shelf.Closed += OnShelfClosed;
            }

            _component.UpdateComponent();
        }
Beispiel #22
0
        /// <summary>
        /// Shows the ROI Histogram component in a shelf.  Only one ROI Histogram component will ever be shown
        /// at a time, so if there is already an ROI Histogram component showing, this method does nothing
        /// </summary>
        public void Show()
        {
            // check if a layout component is already displayed
            if (_cadComponent == null)
            {
                // create and initialize the layout component
                _cadComponent = new CadApplicationComponent(this.Context);

                // launch the layout component in a shelf
                // note that the component is thrown away when the shelf is closed by the user
                ApplicationComponent.LaunchAsShelf(
                    this.Context.DesktopWindow,
                    _cadComponent,
                    SR.Title,
                    ShelfDisplayHint.DockLeft,
                    delegate(IApplicationComponent component) { _cadComponent = null; });
            }
        }
Beispiel #23
0
        /// <summary>
        /// Shows the ROI Histogram component in a shelf.  Only one ROI Histogram component will ever be shown
        /// at a time, so if there is already an ROI Histogram component showing, this method does nothing
        /// </summary>
        public void Show()
        {
            // check if a layout component is already displayed
            if (_roiAnalysisComponent == null)
            {
                // create and initialize the layout component
                _roiAnalysisComponent = new RoiAnalysisComponentContainer(this.Context);

                // launch the layout component in a shelf
                _roiAnalysisShelf = ApplicationComponent.LaunchAsShelf(
                    this.Context.DesktopWindow,
                    _roiAnalysisComponent,
                    SR.Title,
                    ShelfDisplayHint.DockLeft);

                _roiAnalysisShelf.Closed += RoiAnalysisShelf_Closed;
            }
        }
Beispiel #24
0
        public void Show()
        {
            if (_shelf == null)
            {
                ClipboardComponent clipboardComponent = new ClipboardComponent(Clipboard.ClipboardSiteToolbar, Clipboard.ClipboardSiteMenu, Clipboard.Default, false);

                _shelf = ApplicationComponent.LaunchAsShelf(
                    this.Context.DesktopWindow,
                    clipboardComponent,
                    SR.TitleClipboard,
                    "¼ôÇаå",
                    ShelfDisplayHint.DockLeft | ShelfDisplayHint.DockAutoHide);

                _shelf.Closed += OnShelfClosed;
            }
            else
            {
                _shelf.Show();
            }
        }
Beispiel #25
0
        public void Show()
        {
            if (_shelf != null)
            {
                _shelf.Activate();
            }
            else
            {
                ExtensionBrowserComponent browser = new ExtensionBrowserComponent();

                _shelf = ApplicationComponent.LaunchAsShelf(
                    this.Context.DesktopWindow,
                    browser,
                    SR.TitleExtensionBrowser,
                    "Extension Browser",
                    ShelfDisplayHint.DockLeft | ShelfDisplayHint.DockAutoHide);

                _shelf.Closed += OnShelfClosed;
            }
        }
        public void Show()
        {
            if (_shelf == null)
            {
                ClipboardComponent clipboardComponent = new ClipboardComponent();

                _shelf = ApplicationComponent.LaunchAsShelf(
                    this.Context.DesktopWindow,
                    clipboardComponent,
                    SR.TitleClipboard,
                    "Clipboard",
                    ShelfDisplayHint.DockLeft | ShelfDisplayHint.DockAutoHide);

                _shelf.Closed += OnShelfClosed;
            }
            else
            {
                _shelf.Show();
            }
        }
Beispiel #27
0
 /// <summary>
 /// Called by the framework when the user clicks the "apply" menu item or toolbar button.
 /// </summary>
 public void Apply()
 {
     // check if the shelf already exists
     if (_shelf == null)
     {
         // create a new shelf that hosts the SchedulingComponent
         _shelf = ApplicationComponent.LaunchAsShelf(
             this.Context.DesktopWindow,
             new SchedulingComponent(),
             SR.SchedulingTool,
             ShelfDisplayHint.DockRight | ShelfDisplayHint.DockAutoHide,
             delegate(IApplicationComponent c)
         {
             _shelf = null;      // destroy the shelf when the user closes it
         });
     }
     else
     {
         // activate existing shelf
         _shelf.Activate();
     }
 }
        public void CopySubset()
        {
            try
            {
                CopySubsetToClipboardComponent component;

                if (_copySubsetShelf != null)
                {
                    component = (CopySubsetToClipboardComponent)_copySubsetShelf.Component;
                    if (component.DesktopWindow != this.Context.DesktopWindow)
                    {
                        component.Close();
                    }
                    else
                    {
                        _copySubsetShelf.Activate();
                        return;
                    }
                }

                IDesktopWindow desktopWindow = this.Context.DesktopWindow;

                component = new CopySubsetToClipboardComponent(desktopWindow);

                _copySubsetShelf = ApplicationComponent.LaunchAsShelf(
                    desktopWindow,
                    component,
                    SR.TitleCopySubsetToClipboard,
                    ShelfDisplayHint.ShowNearMouse);

                _copySubsetShelf.Closed += delegate { _copySubsetShelf = null; };
            }
            catch (Exception e)
            {
                ExceptionHandler.Report(e, SR.MessageClipboardCopyFailed, Context.DesktopWindow);
            }
        }
        public void Show()
        {
            if (_shelves.ContainsKey(Context.DesktopWindow))
            {
                _shelves[Context.DesktopWindow].Activate();
            }
            else
            {
                BlockingOperation.Run(delegate
                {
                    _desktopWindow   = Context.DesktopWindow;
                    var aimComponent = new AimAnnotationComponent(Context.DesktopWindow);
                    var shelf        = ApplicationComponent.LaunchAsShelf(
                        _desktopWindow,
                        aimComponent,
                        SR.TitleAIMCreater,
                        "AIM Annotation",
                        ShelfDisplayHint.DockRight | ShelfDisplayHint.DockAutoHide);

                    shelf.Closed            += OnShelfClosed;
                    _shelves[_desktopWindow] = shelf;
                });
            }
        }
        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);
                }, true);

                try
                {
                    ProgressDialog.Show(task, _desktopWindow, true);
                }
                catch (Exception e)
                {
                    ExceptionHandler.Report(e, SR.MessageFailedDump, _desktopWindow);
                    return;
                }

                if (userCancelled == true)
                {
                    return;
                }
            }

            //common to both contexts
            if (_shelf != null)
            {
                _shelf.Activate();
            }
            else
            {
                _shelf = ApplicationComponent.LaunchAsShelf(
                    _desktopWindow,
                    _component,
                    SR.TitleDicomEditor,
                    "Dicom Editor",
                    ShelfDisplayHint.DockRight | ShelfDisplayHint.DockAutoHide);
                _shelf.Closed += OnShelfClosed;
            }

            _component.UpdateComponent();
        }