private string GetFormattedErrorMessage(Exception exception, string baseMessage)
        {
            if (exception is Leadtools.Dicom.Scu.Common.ClientConnectionException)
            {
                baseMessage = string.Format("{0}\n{1}\nDICOM Code: {2}\n{3}",
                                            baseMessage,
                                            exception.Message,
                                            ((Leadtools.Dicom.Scu.Common.ClientConnectionException)exception).Code,
                                            DicomException.GetCodeMessage(((Leadtools.Dicom.Scu.Common.ClientConnectionException)exception).Code));
            }
            else if (exception is Leadtools.Dicom.Scu.Common.ClientAssociationException)
            {
                baseMessage = string.Format("{0}\n{1}\nDICOM Reason: {2}\n{3}",
                                            baseMessage,
                                            exception.Message,
                                            ((Leadtools.Dicom.Scu.Common.ClientAssociationException)exception).Reason,
                                            WorkstationUtils.GetAssociationReasonMessage(((Leadtools.Dicom.Scu.Common.ClientAssociationException)exception).Reason));
            }
            else if (exception is Leadtools.Dicom.Scu.Common.ClientCommunicationException)
            {
                baseMessage = baseMessage + "\n" + exception.Message + "\nDICOM Status: " + ((Leadtools.Dicom.Scu.Common.ClientCommunicationException)exception).Status;
            }
            else
            {
                baseMessage = baseMessage + "\n" + exception.Message;
            }

            return(baseMessage);
        }
        public EditAeTitleDialog( )
        {
            InitializeComponent();

            Icon = WorkstationUtils.GetApplicationIcon( );

            AETitleTextBox.Validating += new CancelEventHandler(AETitle_Validating);
        }
예제 #3
0
        public EditServiceDialog(ServerSettings settings)
        {
            InitializeComponent();

            Icon = WorkstationUtils.GetApplicationIcon( );

            ServerAETextBox.Validating += new CancelEventHandler(ServerAE_Validating);
            ServerAETextBox.Validated  += new EventHandler(ServerAETextBox_Validated);

            Settings = settings;
        }
예제 #4
0
            private void HandleStatusChange ( )
            {
               try
               {
                  if ( InvokeRequired )
                  {
                     Invoke ( new MethodInvoker ( HandleStatusChange ) ) ;
                     
                     return ;
                  }
                  
                  if ( null != WorkstationService ) 
                  {
                     bool running = WorkstationService.Status == ServiceControllerStatus.Running ;
                     bool paused  = WorkstationService.Status == ServiceControllerStatus.Paused ;

                     ToolStripButtonStart.Enabled = !running || paused ;
                     StopToolStripButton.Enabled = running || paused ;
                     PauseToolStripButton.Enabled = running ;
                     EditServerToolStripButton.Enabled = true ;
                     
                     AddAeTitleToolStripButton.Enabled    = WorkstationService.IsAdminAvailable ;
                     EditAeTitleToolStripButton.Enabled   = WorkstationService.IsAdminAvailable && AeTitlesListView.SelectedItems.Count > 0;
                     DeleteAeTitleToolStripButton.Enabled = WorkstationService.IsAdminAvailable && AeTitlesListView.SelectedItems.Count > 0;
                     
                     AddServerToolStripButton.Enabled = false ;
                     DeleteServerToolStripButton.Enabled = true ;
                  }
                  else
                  {
                     foreach ( ToolStripItem button in MainToolStrip.Items ) 
                     {
                        if ( button != AddServerToolStripButton  ) 
                        {
                           button.Enabled = false ;
                        }
                     }
                     
                     AddServerToolStripButton.Enabled = true ;
                  }
                  
                   EventLogViewerToolStripButton.Enabled = WorkstationUtils.IsDataAccessSettingsValid ( new LoggingDataAccessConfigurationView ( ).DataAccessSettingsSectionName ) ;
               }
               catch ( Exception exception )
               {
                  System.Diagnostics.Debug.Assert ( false, exception.Message ) ;
                                 
                  throw ;
               }
            }
        public EventLogViewerDialog( )
        {
            InitializeComponent();

            Icon = WorkstationUtils.GetApplicationIcon( );
        }