private void Init ( ) 
            {
               try
               {
                  string serviceName = null ;
                  
                  
                  EventLogViewerToolStripButton.Enabled = EventLogViewer != null ;
                  
                  serviceName = ConfigurationData.ListenerServiceName ;
                     
                  if ( string.IsNullOrEmpty ( serviceName ) )
                  {
                     serviceName = ConfigurationData.ListenerServiceDefaultName ;
                  }

                  CreateServiceManager ( ) ;
                  
                  WorkstationService = ServiceManager.LoadWorkstationListenerService ( serviceName ) ;
                  
                  if ( null == WorkstationService )
                  {
                     try
                     {
                        WorkstationService = CreateDefaultWorkStationService ( ) ;
                     }
                     catch ( Exception ex ) 
                     {
                        ThreadSafeMessager.ShowError (  ex.Message ) ;
                        
                        WorkstationService = null ;
                     }
                  }
                  
                  HandleStatusChange ( ) ;
                  
                  if ( null == WorkstationService ) 
                  {
                     ThreadSafeMessager.ShowWarning (  "No Listener service installed." ) ; 
                  }
               }
               catch ( Exception exception )
               {
                  System.Diagnostics.Debug.Assert ( false, exception.Message ) ;
                  
                  HandleStatusChange ( ) ;
                  
                  throw ;
               }
            }
            void ServiceManager_ServerError(object sender, Leadtools.Dicom.Server.Admin.ErrorEventArgs e)
            {
               if ( ( null != e.Error ) && ( e.Error is BadImageFormatException ) )
               {
                  string demoVersoin   = "32";
                  string addInsVersion = "64";
                  
                  string msg = 
                    "Error loading [{0}].\n\n" + 
                    "This {1}-bit {3} process cannot load {2}-bit AddIn dlls, so the AddIn options can not be displayed.  " +
                    "Please use the {2}-bit version of the {3} to view the AddIn options.\n\n" + 
                    "Note:\n" +
                    "If you prefer to use the {1}-bit version of the AddIn dlls you can delete the current service and reinstall it from this {3}:\n" + 
                    "* To delete the service, click on 'Delete Server' button from the Workstation Listener Service Manager.\n" + 
                    "* To install a new service, click on 'Add Server' and enter the service information -or leave the defaults- in the dialog then click ok.\n" ;

                  string message = string.Empty;

                   if ( DemosGlobal.Is64Process ( ) )
                   {
                      demoVersoin   = "64";
                      addInsVersion = "32";
                   }
                   else
                   {
                      demoVersoin   = "32";
                      addInsVersion = "64";
                   }
                   
                   message = string.Format(msg, (e.Error as BadImageFormatException).FileName, demoVersoin, addInsVersion, Messager.Caption );
                   
                   ThreadSafeMessager.ShowWarning (  message ) ;
               }
               else
               {
                  ThreadSafeMessager.ShowError (  e.Error.Message ) ;
               }
            }
Exemple #3
0
 public void ReportServerVerificationFailure(string errorMessage)
 {
     ThreadSafeMessager.ShowWarning(errorMessage);
 }