void __WorkstationViewer_SeriesDropLoaderRequested(object sender, SeriesDropLoaderRequestedEventArgs e)
        {
            try
            {
                MedicalViewerLoader loader;


                if (!ConfigurationData.SupportLocalQueriesStore)
                {
                    loader = new MedicalViewerLoader(DicomClientFactory.CreateRetrieveClient( ));
                }
                else
                {
                    loader = new MedicalViewerLoader(DicomClientFactory.CreateLocalRetrieveClient( ));
                }

                InitMedicalViewerLoader(loader);

                e.SeriesLoader = loader;
            }
            catch (Exception exception)
            {
                ThreadSafeMessager.ShowError(exception.Message);
            }
        }
        private void __SearchStudies_RetrieveSeries(object sender, StoreSeriesEventArgs e)
        {
            try
            {
                PopulateState(e.Study, e.Series);

                if (!__QueueManager.Visible)
                {
                    __QueueManager.Show(View.DisplayContainer);
                }

                DicomScp                 scp;
                string                   patientID;
                string                   description;
                PacsRetrieveClient       client;
                RetrieveQueueItemCommand retrieveCommand;


                scp = new DicomScp( );

                scp.AETitle     = e.Server.AETitle;
                scp.PeerAddress = Utils.ResolveIPAddress(e.Server.Address);
                scp.Port        = e.Server.Port;
                scp.Timeout     = e.Server.Timeout;
                scp.Secure      = e.Server.Secure;

                patientID = e.Study.IsPatientIDNull( ) ? string.Empty : e.Study.PatientID;

                description = string.Format(SeriesInfo,
                                            e.Study.IsPatientNameNull( ) ? string.Empty : e.Study.PatientName,
                                            patientID,
                                            e.Series.IsSeriesNumberNull( ) ? string.Empty : e.Series.SeriesNumber,
                                            e.Series.IsModalityNull( ) ? string.Empty : e.Series.Modality);


                client = DicomClientFactory.CreatePacsRetrieveClient(scp);

                retrieveCommand = new RetrieveQueueItemCommand(new SeriesInformation(patientID,
                                                                                     e.Study.StudyInstanceUID,
                                                                                     e.Series.SeriesInstanceUID,
                                                                                     description),
                                                               client);


                __QueueManager.AddCommand(retrieveCommand);
            }
            catch (Exception exception)
            {
                ThreadSafeMessager.ShowError(exception.Message);
            }
        }
        private void LoadSeriesInViewer
        (
            string patientID,
            string studyInstanceUID,
            string seriesInstanceUID,
            DicomClientMode clientMode
        )
        {
            if (null == __WorkstationViewer)
            {
                return;
            }

            MedicalViewerLoader loader;


            loader = new MedicalViewerLoader(DicomClientFactory.CreateRetrieveClient(clientMode));

            InitMedicalViewerLoader(loader);

            if (__WorkstationViewer.InvokeRequired)
            {
                __WorkstationViewer.Invoke(new MethodInvoker(delegate
                {
                    __WorkstationViewer.LoadSeries(patientID,
                                                   studyInstanceUID,
                                                   seriesInstanceUID,
                                                   loader);
                }));
            }
            else
            {
                __WorkstationViewer.LoadSeries(patientID,
                                               studyInstanceUID,
                                               seriesInstanceUID,
                                               loader);
            }
        }