Example #1
0
        public void Launch()
        {
            if (_workspace == null)
            {
                try
                {
                    var component = new StaffGroupSummaryComponent();

                    _workspace = ApplicationComponent.LaunchAsWorkspace(
                        this.Context.DesktopWindow,
                        component,
                        "Staff Groups");
                    _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
                {
                    ModalitySummaryComponent component = new ModalitySummaryComponent();

                    _workspace = ApplicationComponent.LaunchAsWorkspace(
                        this.Context.DesktopWindow,
                        component,
                        SR.TitleModalities);
                    _workspace.Closed += delegate { _workspace = null; };
                }
                catch (Exception e)
                {
                    // could not launch editor
                    ExceptionHandler.Report(e, this.Context.DesktopWindow);
                }
            }
            else
            {
                _workspace.Activate();
            }
        }
Example #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
            {
                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;
        }
Example #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
            {
                // 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;
        }
Example #5
0
        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();
            }
        }
Example #6
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();
            }
        }
        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();
            }
        }
Example #8
0
 /// <summary>
 /// Default clickHandler implementation for <see cref="MenuAction"/> and/or <see cref="ButtonAction"/> attributes.
 /// These attributes must be specified on subclasses.
 /// </summary>
 public void Launch()
 {
     if (_workspace == null)
     {
         Open();
     }
     else
     {
         _workspace.Activate();
     }
 }
Example #9
0
        void SwitchWorkspace(IWorkspace newWorkspace)
        {
            if (CurrentWorkspace != null)
            {
                CurrentWorkspace.Activate(false);
            }

            CurrentWorkspace = newWorkspace;
            CurrentWorkspace.Activate(true);

            EventManager.TriggerEvent(new EventOnWorkspaceSwitched(CurrentWorkspace));
        }
Example #10
0
        public void ActivateViewer(ActivateViewerRequest request)
        {
            if (request == null)
            {
                string message = "The activate viewer request cannot be null.";
                Platform.Log(LogLevel.Debug, message);
                throw new FaultException(message);
            }

            if (request.Viewer == null || request.Viewer.Identifier.Equals(Guid.Empty))
            {
                string message = "A valid viewer id must be specified.";
                Platform.Log(LogLevel.Debug, message);
                throw new FaultException(message);
            }

            IImageViewer viewer = ViewerAutomationTool.GetViewer(request.Viewer.Identifier);

            if (viewer == null)
            {
                string message = String.Format("The specified viewer ({0}) was not found, " +
                                               "likely because it has already been closed by the user.", request.Viewer.Identifier);
                Platform.Log(LogLevel.Debug, message);

                throw new FaultException <ViewerNotFoundFault>(new ViewerNotFoundFault(message), _viewerNotFoundReason);
            }

            IWorkspace workspace = GetViewerWorkspace(viewer);

            if (workspace == null)
            {
                string message = String.Format("The specified viewer ({0}) was found, " +
                                               "but does not appear to be hosted in one of the active workspaces.", request.Viewer.Identifier);
                Platform.Log(LogLevel.Error, message);

                throw new FaultException <ViewerNotFoundFault>(new ViewerNotFoundFault(message), _viewerNotFoundReason);
            }

            try
            {
                workspace.Activate();
            }
            catch (Exception e)
            {
                string message = String.Format("An unexpected error has occurred while attempting " +
                                               "to activate the specified viewer ({0}).", request.Viewer.Identifier);
                Platform.Log(LogLevel.Error, e, message);
                throw new FaultException(message);
            }
        }
Example #11
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);
     }
 }
 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();
     }
 }
Example #13
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();
     }
 }
        public void Launch()
        {
            if (_workspace == null)
            {
                try
                {
                    ProcedureTypeGroupSummaryComponent component = new ProcedureTypeGroupSummaryComponent();

                    _workspace = ApplicationComponent.LaunchAsWorkspace(
                        this.Context.DesktopWindow,
                        component,
                        SR.TitleProcedureTypeGroup);
                    _workspace.Closed += delegate { _workspace = null; };
                }
                catch (Exception e)
                {
                    ExceptionHandler.Report(e, this.Context.DesktopWindow);
                }
            }
            else
            {
                _workspace.Activate();
            }
        }
 public void Activate(object smartPart)
 {
     workspace.Activate(smartPart);
 }