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);
            }
        }
        void __SearchStudies_StoreSeries(object sender, StoreSeriesEventArgs e)
        {
            try
            {
                PopulateState(e.Study, e.Series);

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

                DicomScp scp;
                string   patientID;
                string   description;
                IStorageDataAccessAgent dataAccess;
                Compression             compression;
                StoreQueueItemCommand   storeCommand;

                if (!ConfigurationData.Compression.Enable)
                {
                    compression = Leadtools.Dicom.Scu.Common.Compression.Native;
                }
                else
                {
                    compression = (ConfigurationData.Compression.Lossy) ? Leadtools.Dicom.Scu.Common.Compression.Lossy : Leadtools.Dicom.Scu.Common.Compression.Lossless;
                }

                scp = new Leadtools.Dicom.Scu.DicomScp( );

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

                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);

                dataAccess = DataAccessServices.GetDataAccessService <IStorageDataAccessAgent> ( );

                if (null == dataAccess)
                {
                    throw new InvalidOperationException("Storage Service is not registered.");
                }

                StoreClient client = new StoreClient(ConfigurationData.WorkstationClient.ToAeInfo( ),
                                                     scp,
                                                     compression,
                                                     dataAccess);


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

                QueueManager.Instance.AddCommand(storeCommand);
            }
            catch (Exception exception)
            {
                ThreadSafeMessager.ShowError(exception.Message);
            }
        }