Esempio n. 1
0
        private void Open()
        {
            try
            {
                IApplicationComponent component = CreateComponent();

                if (component != null)
                {
                    WorkspaceCreationArgs args = new WorkspaceCreationArgs(component, this.Title, null);
                    args.UserClosable  = this.IsUserClosableWorkspace;
                    _workspace         = ApplicationComponent.LaunchAsWorkspace(this.Context.DesktopWindow, args);
                    _workspace.Closed += delegate
                    {
                        _workspace = null;
                        FolderExplorerComponentSettings.Default.UserConfigurationSaved -= OnUserConfigurationSaved;
                    };

                    FolderExplorerComponentSettings.Default.UserConfigurationSaved += OnUserConfigurationSaved;
                }
            }
            catch (Exception e)
            {
                // could not launch component
                ExceptionHandler.Report(e, this.Context.DesktopWindow);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Launches the <see cref="SettingsManagementComponent"/> or activates it if it's already open.
        /// </summary>
        /// <remarks>
        /// This method first looks for a valid extension of <see cref="SettingsStoreExtensionPoint"/> and
        /// with which to initialize the <see cref="SettingsManagementComponent"/>.  If one is not found,
        /// an instance of <see cref="LocalSettingsStore"/> is instantiated and passed to the
        /// <see cref="SettingsManagementComponent"/>.  The <see cref="LocalSettingsStore"/> allows
        /// the local application settings to be modified, where by default they cannot be.
        /// </remarks>
        public void Activate()
        {
            if (_workspace != null)
            {
                _workspace.Activate();
                return;
            }

            ISettingsStore store;

            try
            {
                store = SettingsStore.Create();
            }
            catch (NotSupportedException)
            {
                // there is no central settings store
                store = new NullSettingsStore();
            }

            if (!store.IsOnline)
            {
                Context.DesktopWindow.ShowMessageBox(SR.MessageSettingsStoreOffline, MessageBoxActions.Ok);
                return;
            }

            _workspace = ApplicationComponent.LaunchAsWorkspace(
                this.Context.DesktopWindow,
                new SettingsManagementComponent(store),
                SR.TitleSettingsEditor,
                "Settings Management");

            _workspace.Closed += OnWorkspaceClosed;
        }
Esempio n. 3
0
        /// <summary>
        /// Launches the <see cref="SettingsManagementComponent"/> or activates it if it's already open.
        /// </summary>
        /// <remarks>
        /// This method first looks for a valid extension of <see cref="SettingsStoreExtensionPoint"/> and
        /// with which to initialize the <see cref="SettingsManagementComponent"/>.  If one is not found,
        /// an instance of <see cref="LocalSettingsStore"/> is instantiated and passed to the
        /// <see cref="SettingsManagementComponent"/>.  The <see cref="LocalSettingsStore"/> allows
        /// the local application settings to be modified, where by default they cannot be.
        /// </remarks>
        public void Activate()
        {
            if (_workspace != null)
            {
                _workspace.Activate();
                return;
            }

            ISettingsStore store;

            try
            {
                // if this throws an exception, only the default LocalFileSettingsProvider can be used.
                store = SettingsStore.Create();
            }
            catch (NotSupportedException)
            {
                //allow editing of the app.config file via the LocalSettingsStore.
                store = new LocalSettingsStore();
            }

            if (!store.IsOnline)
            {
                base.Context.DesktopWindow.ShowMessageBox(SR.MessageSettingsStoreOffline, MessageBoxActions.Ok);
                return;
            }

            _workspace = ApplicationComponent.LaunchAsWorkspace(
                this.Context.DesktopWindow,
                new SettingsManagementComponent(store),
                SR.TitleSettingsEditor,
                "Settings Management");

            _workspace.Closed += OnWorkspaceClosed;
        }
Esempio n. 4
0
        /// <summary>
        /// Launches the <see cref="SettingsManagementComponent"/> or activates it if it's already open.
        /// </summary>
        /// <remarks>
        /// This method first looks for a valid extension of <see cref="SettingsStoreExtensionPoint"/> and
        /// with which to initialize the <see cref="SettingsManagementComponent"/>.  If one is not found,
        /// an instance of <see cref="LocalSettingsStore"/> is instantiated and passed to the
        /// <see cref="SettingsManagementComponent"/>.  The <see cref="LocalSettingsStore"/> allows
        /// the local application settings to be modified, where by default they cannot be.
        /// </remarks>
        public void Activate()
        {
            if (_workspace != null)
            {
                _workspace.Activate();
                return;
            }

            ISettingsStore store;

            try
            {
                store = SettingsStore.Create();
                //If there is a store, and it is not online, then settings can't be edited.
                if (!store.IsOnline)
                {
                    Context.DesktopWindow.ShowMessageBox(SR.MessageSettingsStoreOffline, MessageBoxActions.Ok);
                    return;
                }
            }
            catch (NotSupportedException)
            {
                // There is no central settings store; all settings will be treated as though they were local.
                store = new NullSettingsStore();
            }

            _workspace = ApplicationComponent.LaunchAsWorkspace(
                this.Context.DesktopWindow,
                new SettingsManagementComponent(store),
                SR.TitleSettingsEditor,
                "Settings Management");

            _workspace.Closed += OnWorkspaceClosed;
        }
Esempio n. 5
0
        public void Launch()
        {
            if (_workspace == null)
            {
                try
                {
                    DataImportComponent component = new DataImportComponent();

                    _workspace = ApplicationComponent.LaunchAsWorkspace(
                        this.Context.DesktopWindow,
                        component,
                        SR.TitleImportData);
                    _workspace.Closed += delegate { _workspace = null; };
                }
                catch (Exception e)
                {
                    // failed to launch component
                    ExceptionHandler.Report(e, this.Context.DesktopWindow);
                }
            }
            else
            {
                _workspace.Activate();
            }
        }
Esempio n. 6
0
        public void Launch()
        {
            if (_workspace == null)
            {
                try
                {
                    LocationSummaryComponent component = new LocationSummaryComponent();

                    _workspace = ApplicationComponent.LaunchAsWorkspace(
                        this.Context.DesktopWindow,
                        component,
                        SR.TitleLocations);
                    _workspace.Closed += delegate { _workspace = null; };
                }
                catch (Exception e)
                {
                    // could not launch component
                    ExceptionHandler.Report(e, this.Context.DesktopWindow);
                }
            }
            else
            {
                _workspace.Activate();
            }
        }
        public void Launch()
        {
            if (_workspace == null)
            {
                try
                {
                    if (Application.SessionStatus != SessionStatus.Online)
                    {
                        Context.DesktopWindow.ShowMessageBox(SR.MessageServerOffline, MessageBoxActions.Ok);
                        return;
                    }

                    UserSummaryComponent component = new UserSummaryComponent();

                    _workspace = ApplicationComponent.LaunchAsWorkspace(
                        this.Context.DesktopWindow,
                        component,
                        SR.TitleUser);
                    _workspace.Closed += delegate { _workspace = null; };
                }
                catch (Exception e)
                {
                    // could not launch component
                    ExceptionHandler.Report(e, this.Context.DesktopWindow);
                }
            }
            else
            {
                _workspace.Activate();
            }
        }
        public void Launch()
        {
            if (_workspace == null)
            {
                try
                {
                    DiagnosticServiceSummaryComponent component = new DiagnosticServiceSummaryComponent();

                    _workspace = ApplicationComponent.LaunchAsWorkspace(
                        this.Context.DesktopWindow,
                        component,
                        "Imaging Services");
                    _workspace.Closed += delegate { _workspace = null; };
                }
                catch (Exception e)
                {
                    // failed to launch component
                    ExceptionHandler.Report(e, this.Context.DesktopWindow);
                }
            }
            else
            {
                _workspace.Activate();
            }
        }
        public void Launch()
        {
            if (_workspace == null)
            {
                try
                {
                    ValidationManagementComponent component = new ValidationManagementComponent();

                    _workspace = ApplicationComponent.LaunchAsWorkspace(
                        this.Context.DesktopWindow,
                        component,
                        "UI Validation Management");
                    _workspace.Closed += delegate { _workspace = null; };
                }
                catch (Exception e)
                {
                    // could not launch component
                    ExceptionHandler.Report(e, this.Context.DesktopWindow);
                }
            }
            else
            {
                _workspace.Activate();
            }
        }
Esempio n. 10
0
        public void Launch()
        {
            if (_workspace == null)
            {
                try
                {
                    if (Application.SessionStatus != SessionStatus.Online)
                    {
                        Context.DesktopWindow.ShowMessageBox(SR.MessageServerOffline, MessageBoxActions.Ok);
                        return;
                    }

                    var component = new AuthorityGroupSummaryComponent();

                    _workspace = ApplicationComponent.LaunchAsWorkspace(
                        Context.DesktopWindow,
                        component,
                        SR.TitleAuthorityGroup);
                    _workspace.Closed += delegate { _workspace = null; };
                }
                catch (Exception e)
                {
                    ExceptionHandler.Report(e, Context.DesktopWindow);
                }
            }
            else
            {
                _workspace.Activate();
            }
        }
Esempio n. 11
0
        public void Launch()
        {
            if (_workspace == null)
            {
                try
                {
                    $fileinputname$SummaryComponent component = new $fileinputname$SummaryComponent();

                    _workspace = ApplicationComponent.LaunchAsWorkspace(
                        this.Context.DesktopWindow,
                        component,
                        "$fileinputname$");
                    _workspace.Closed += delegate { _workspace = null; };
                }
                catch (Exception e)
                {
                    // failed to launch component
                    ExceptionHandler.Report(e, this.Context.DesktopWindow);
                }
            }
            else
            {
                _workspace.Activate();
            }
        }
Esempio n. 12
0
        /// <summary>
        /// Called by the framework when the user clicks the "apply" menu item or toolbar button.
        /// </summary>
        public void Apply()
        {
            // check if a layout component is already displayed
            if (_shelves.ContainsKey(this.Context.DesktopWindow))
            {
                _shelves[this.Context.DesktopWindow].Activate();
            }
            else
            {
                BlockingOperation.Run(delegate
                {
                    _desktopWindow = Context.DesktopWindow;

                    var atsWebBrowserContainer = ATSWebBrowserContainer.Create(_desktopWindow);
                    var atsWebBrowserComponent =
                        atsWebBrowserContainer.Pane1.Component as ATSWebBrowserComponent;
                    var aimAnnotationComponent =
                        atsWebBrowserContainer.Pane2.Component as AimAnnotationComponent;

                    if (atsWebBrowserComponent != null && aimAnnotationComponent != null)
                    {
                        ApplicationComponent.LaunchAsWorkspace(Context.DesktopWindow, atsWebBrowserContainer, SR.WorkspaceName);
                        atsWebBrowserComponent.Url = Configuration.AtsSettings.Default.AtsUrl;
                        atsWebBrowserComponent.AimAnnotationComponent = aimAnnotationComponent;
                        atsWebBrowserComponent.Go();
                    }
                });
            }
        }
        public void Launch()
        {
            if (_workspace == null)
            {
                try
                {
                    ProcedureTypeSummaryComponent component = new ProcedureTypeSummaryComponent();

                    _workspace = ApplicationComponent.LaunchAsWorkspace(
                        this.Context.DesktopWindow,
                        component,
                        "Procedure Types");
                    _workspace.Closed += delegate { _workspace = null; };
                }
                catch (Exception e)
                {
                    // could not launch editor
                    ExceptionHandler.Report(e, this.Context.DesktopWindow);
                }
            }
            else
            {
                _workspace.Activate();
            }
        }
Esempio n. 14
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; };
        }
Esempio n. 15
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

            WebBrowserComponent component = new WebBrowserComponent();

            ApplicationComponent.LaunchAsWorkspace(this.Context.DesktopWindow, component, SR.WorkspaceName);
        }
        /// <summary>
        /// Called by the framework when the user clicks the "apply" menu item or toolbar button.
        /// </summary>
        public void Apply()
        {
            var component = new XnatWebBrowserComponent();

            ApplicationComponent.LaunchAsWorkspace(Context.DesktopWindow, component, SR.WorkspaceName);
            component.Url = "https://central.xnat.org/";
            component.SetDocumentTitle("XNAT Imaging");
            component.Go();
            component.Stopped += ComponentStopped;
            Active             = true;
        }
Esempio n. 17
0
        private Workspace LaunchWorkspace()
        {
            Workspace workspace = null;

            try
            {
                workspace = ApplicationComponent.LaunchAsWorkspace(
                    _desktopWindow,
                    GetComponent(),
                    GetTitle(),
                    _key);
            }
            catch (Exception e)
            {
                // could not launch component
                ExceptionHandler.Report(e, _desktopWindow);
            }

            return(workspace);
        }
Esempio n. 18
0
        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;
            });
        }
 public void Launch()
 {
     if (_workspace == null)
     {
         try
         {
             _workspace = ApplicationComponent.LaunchAsWorkspace(
                 this.Context.DesktopWindow,
                 new WorkQueueAdminComponent(),
                 SR.TitleWorkQueue);
             _workspace.Closed += delegate { _workspace = null; };
         }
         catch (Exception e)
         {
             ExceptionHandler.Report(e, this.Context.DesktopWindow);
         }
     }
     else
     {
         _workspace.Activate();
     }
 }
Esempio n. 20
0
 public void Launch()
 {
     try
     {
         if (_workspace == null)
         {
             _workspace = ApplicationComponent.LaunchAsWorkspace(
                 this.Context.DesktopWindow,
                 BuildComponent(),
                 SR.TitlePatientSearch);
             _workspace.Closed += delegate { _workspace = null; };
         }
         else
         {
             _workspace.Activate();
         }
     }
     catch (Exception e)
     {
         ExceptionHandler.Report(e, this.Context.DesktopWindow);
     }
 }
Esempio n. 21
0
 public void Launch()
 {
     if (_workspace == null)
     {
         try
         {
             _workspace = ApplicationComponent.LaunchAsWorkspace(
                 this.Context.DesktopWindow,
                 new ExternalPractitionerSummaryComponent(),
                 SR.TitleExternalPractitioner);
             _workspace.Closed += delegate { _workspace = null; };
         }
         catch (Exception e)
         {
             // failed to launch component
             ExceptionHandler.Report(e, this.Context.DesktopWindow);
         }
     }
     else
     {
         _workspace.Activate();
     }
 }
Esempio n. 22
0
        public static void ShowExplorer(IDesktopWindow desktopWindow)
        {
            //try
            //{
            //    string[] files = { "e:\\26885681.dcm", "e:\\26885683.dcm" };
            //    new OpenFilesHelper(files) { WindowBehaviour = ViewerLaunchSettings.WindowBehaviour }.OpenFiles();
            //}
            //catch (Exception e)
            //{
            //    //ExceptionHandler.Report(e, SR.MessageUnableToOpenImages, Context.DesktopWindow);
            //}
            Platform.Log(LogLevel.Error, "starting download file");
            DownloadDicomFile downloadfile = new DownloadDicomFile();

            downloadfile.DownloadImages();
            string[] files          = downloadfile.m_files.ToArray();
            string   strPatientName = downloadfile.PatientName;

            try
            {
                new OpenFilesHelper(files)
                {
                    WindowBehaviour = ViewerLaunchSettings.WindowBehaviour
                }.OpenFiles(strPatientName);
            }
            catch (Exception e)
            {
                Platform.Log(LogLevel.Error, e.ToString());
                //ExceptionHandler.Report(e, SR.MessageUnableToOpenImages, Context.DesktopWindow);
            }

            return;


            if (_desktopObject != null)
            {
                _desktopObject.Activate();
                return;
            }
            //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(desktopWindow, args);
            }
            else
            {
                WorkspaceCreationArgs args = new WorkspaceCreationArgs();
                args.Component = container;
                args.Title     = SR.TitleExplorer;
                //args.Title = "打开本地文件";
                args.Name         = "Explorer";
                args.UserClosable = IsWorkspaceClosable;

                _desktopObject = ApplicationComponent.LaunchAsWorkspace(desktopWindow, args);
            }

            _desktopObject.Closed += delegate { _desktopObject = null; };
        }