private void InitializeAutoCopy(AutoCopyView autoCopyView, AutoCopyPresenter autoCopyPresenter) { if (ServerState.Instance.ServerService != null) { AdvancedSettings settings = AdvancedSettings.Open(ServerState.Instance.ServerService.ServiceDirectory); autoCopyPresenter.RunView(autoCopyView, settings); } else { autoCopyPresenter.RunView(autoCopyView, null); } __AutoCopyPresenter = autoCopyPresenter; }
public void Initialize(AdvancedSettings advancedSettings, ServerSettings Settings, string ServerDirectory) { _AdvancedSettings = advancedSettings; _Settings = Settings; if (Settings != null) { Module.ServiceName = Settings.ServiceName; } try { IAeManagementDataAccessAgent aeManagementAgent; if (!DataAccessServices.IsDataAccessServiceRegistered <IAeManagementDataAccessAgent>()) { aeManagementAgent = DataAccessFactory.GetInstance(new AeManagementDataAccessConfigurationView(DicomDemoSettingsManager.GetGlobalPacsAddinsConfiguration(ServerDirectory), null, Settings.ServiceName)).CreateDataAccessAgent <IAeManagementDataAccessAgent>(); DataAccessServices.RegisterDataAccessService <IAeManagementDataAccessAgent>(aeManagementAgent); } else { aeManagementAgent = DataAccessServices.GetDataAccessService <IAeManagementDataAccessAgent>(); } _autoCopyDlg = new ConfigureDialog( ); _autoCopyPresenter = new AutoCopyPresenter( ); _autoCopyPresenter.RunView(_autoCopyDlg.AutoCopyView, advancedSettings); } catch (Exception e) { Logger.Global.Exception(Module.Source, e); } }