///-------------------------------------------------------------------------------- /// <summary>This method disposes of resources in the model.</summary> ///-------------------------------------------------------------------------------- protected override void OnDispose() { if (ReverseInstance != null) { ReverseInstance.Dispose(); ReverseInstance = null; } if (ForwardInstance != null) { ForwardInstance.Dispose(); ForwardInstance = null; } Solution = null; Solution = null; if (_viewPropertyList != null) { foreach (ViewProperty item in ViewPropertyList) { item.Dispose(); } ViewPropertyList.Clear(); ViewPropertyList = null; } #region protected #endregion protected base.OnDispose(); }
///-------------------------------------------------------------------------------- /// <summary>This method disposes of resources in the model.</summary> ///-------------------------------------------------------------------------------- protected override void OnDispose() { if (ReverseInstance != null) { ReverseInstance.Dispose(); ReverseInstance = null; } if (ForwardInstance != null) { ForwardInstance.Dispose(); ForwardInstance = null; } ModelObject = null; Solution = null; if (_propertyInstanceList != null) { foreach (PropertyInstance item in PropertyInstanceList) { item.Dispose(); } PropertyInstanceList.Clear(); PropertyInstanceList = null; } #region protected #endregion protected base.OnDispose(); }
///-------------------------------------------------------------------------------- /// <summary>This method disposes of resources in the model.</summary> ///-------------------------------------------------------------------------------- protected override void OnDispose() { if (ReverseInstance != null) { ReverseInstance.Dispose(); ReverseInstance = null; } if (ForwardInstance != null) { ForwardInstance.Dispose(); ForwardInstance = null; } Entity = null; Solution = null; if (_stateList != null) { foreach (State item in StateList) { item.Dispose(); } StateList.Clear(); StateList = null; } #region protected #endregion protected base.OnDispose(); }
///-------------------------------------------------------------------------------- /// <summary>This method disposes of resources in the model.</summary> ///-------------------------------------------------------------------------------- protected override void OnDispose() { if (ReverseInstance != null) { ReverseInstance.Dispose(); ReverseInstance = null; } if (ForwardInstance != null) { ForwardInstance.Dispose(); ForwardInstance = null; } Solution = null; Solution = null; if (_diagramEntityList != null) { foreach (DiagramEntity item in DiagramEntityList) { item.Dispose(); } DiagramEntityList.Clear(); DiagramEntityList = null; } #region protected #endregion protected base.OnDispose(); }
///-------------------------------------------------------------------------------- /// <summary>This method disposes of resources in the model.</summary> ///-------------------------------------------------------------------------------- protected override void OnDispose() { if (ReverseInstance != null) { ReverseInstance.Dispose(); ReverseInstance = null; } if (ForwardInstance != null) { ForwardInstance.Dispose(); ForwardInstance = null; } Enumeration = null; Solution = null; if (_definedByModelPropertyList != null) { foreach (ModelProperty item in DefinedByModelPropertyList) { item.Dispose(); } DefinedByModelPropertyList.Clear(); DefinedByModelPropertyList = null; } #region protected #endregion protected base.OnDispose(); }
///-------------------------------------------------------------------------------- /// <summary>This method disposes of resources in the model.</summary> ///-------------------------------------------------------------------------------- protected override void OnDispose() { if (ReverseInstance != null) { ReverseInstance.Dispose(); ReverseInstance = null; } if (ForwardInstance != null) { ForwardInstance.Dispose(); ForwardInstance = null; } Solution = null; #region protected #endregion protected base.OnDispose(); }
public ForwardInstance[] GetCleanList() { List <ForwardInstance> list = new List <ForwardInstance>(); using (DbCommand command = DatabaseProvider.DbProviderFactory.CreateCommand()) { InitializeGetCleanListCommand(command); using (IDataReader reader = DatabaseProvider.ExecuteReader(command)) { while (reader.Read()) { ForwardInstance instance = new ForwardInstance(); instance.SOPInstanceUID = reader.GetColumnValue <string>(ColumnNameSOPInstanceUID); instance.ReferencedFile = reader.GetColumnValue <string>(ColumnNameReferencedFile); list.Add(instance); } } } return(list.ToArray()); }
///-------------------------------------------------------------------------------- /// <summary>This method disposes of resources in the model.</summary> ///-------------------------------------------------------------------------------- protected override void OnDispose() { if (ReverseInstance != null) { ReverseInstance.Dispose(); ReverseInstance = null; } if (ForwardInstance != null) { ForwardInstance.Dispose(); ForwardInstance = null; } Solution = null; Solution = null; if (_enumerationList != null) { foreach (Enumeration item in EnumerationList) { item.Dispose(); } EnumerationList.Clear(); EnumerationList = null; } if (_modelObjectList != null) { foreach (ModelObject item in ModelObjectList) { item.Dispose(); } ModelObjectList.Clear(); ModelObjectList = null; } #region protected #endregion protected base.OnDispose(); }
///-------------------------------------------------------------------------------- /// <summary>This method disposes of resources in the model.</summary> ///-------------------------------------------------------------------------------- protected override void OnDispose() { if (ReverseInstance != null) { ReverseInstance.Dispose(); ReverseInstance = null; } if (ForwardInstance != null) { ForwardInstance.Dispose(); ForwardInstance = null; } Solution = null; Solution = null; if (_referencedParameterList != null) { foreach (Parameter item in ReferencedParameterList) { item.Dispose(); } ReferencedParameterList.Clear(); ReferencedParameterList = null; } if (_propertyRelationshipList != null) { foreach (PropertyRelationship item in PropertyRelationshipList) { item.Dispose(); } PropertyRelationshipList.Clear(); PropertyRelationshipList = null; } #region protected #endregion protected base.OnDispose(); }
///-------------------------------------------------------------------------------- /// <summary>This method disposes of resources in the model.</summary> ///-------------------------------------------------------------------------------- protected override void OnDispose() { if (ReverseInstance != null) { ReverseInstance.Dispose(); ReverseInstance = null; } if (ForwardInstance != null) { ForwardInstance.Dispose(); ForwardInstance = null; } Stage = null; Solution = null; if (_fromStepTransitionList != null) { foreach (StepTransition item in FromStepTransitionList) { item.Dispose(); } FromStepTransitionList.Clear(); FromStepTransitionList = null; } if (_toStepTransitionList != null) { foreach (StepTransition item in ToStepTransitionList) { item.Dispose(); } ToStepTransitionList.Clear(); ToStepTransitionList = null; } #region protected #endregion protected base.OnDispose(); }
///-------------------------------------------------------------------------------- /// <summary>This method disposes of resources in the model.</summary> ///-------------------------------------------------------------------------------- protected override void OnDispose() { if (ReverseInstance != null) { ReverseInstance.Dispose(); ReverseInstance = null; } if (ForwardInstance != null) { ForwardInstance.Dispose(); ForwardInstance = null; } Solution = null; if (_propertyList != null) { foreach (Property item in PropertyList) { item.Dispose(); } PropertyList.Clear(); PropertyList = null; } if (_auditPropertyList != null) { foreach (AuditProperty item in AuditPropertyList) { item.Dispose(); } AuditPropertyList.Clear(); AuditPropertyList = null; } #region protected #endregion protected base.OnDispose(); }
public void InternalRunThread(DicomScp scp, IForwardDataAccessAgent forwardAgent) { lock (forwardLock) { if (_serviceShuttingDown) { return; } ForwardInstance[] instances; try { instances = forwardAgent.GetForwardList(); } catch (Exception ex) { Logger.Global.SystemMessage(LogType.Error, ex.ToString(), _ServerAE); // throw; instances = new ForwardInstance[0]; } string message = string.Format("[Forwarder] {0} {1} found to forward", instances.Length, instances.Length == 1 ? "dataset" : "datasets"); Logger.Global.SystemMessage(LogType.Debug, message, _ServerAE); if (instances.Length > 0 && _Options.Verify) { message = string.Format("[Forwarder] {0} {1} will be verified after forwarding", instances.Length, instances.Length == 1 ? "instance" : "instances"); Logger.Global.SystemMessage(LogType.Warning, message, _ServerAE); } foreach (ForwardInstance instance in instances) { #if LEADTOOLS_V18_OR_LATER if (_cancelForward) { _cancelForward = false; Logger.Global.SystemMessage(LogType.Information, string.Format("Cancelling Forward Process"), _ServerAE); break; } if (_serviceShuttingDown) { break; } #endif // #if LEADTOOLS_V18_OR_LATER try { if (!File.Exists(instance.ReferencedFile)) { message = string.Format("[Forwarder] Referenced file doesn't exist. Instance ({0}) will be removed from forwarding queue. [{1}]", instance.SOPInstanceUID, instance.ReferencedFile); Logger.Global.SystemMessage(LogType.Warning, message, _ServerAE); forwardAgent.SetInstanceForwarded(instance.SOPInstanceUID, DateTime.Now, null); continue; } // SendInstance can fail because DicomEngine may be locked DicomCommandStatusType status = DicomCommandStatusType.Success; try { status = SendInstance(scp, instance); } catch (Exception) { // Console.WriteLine(ex.Message); throw; } if (status == DicomCommandStatusType.Success || status == DicomCommandStatusType.DuplicateInstance) { DateTime?expires = null; DateTime forwardDate = DateTime.Now; if (_Options.ImageHold != null && _Options.ImageHold != 0) { switch (_Options.HoldInterval) { case HoldInterval.Days: expires = forwardDate.AddDays(_Options.ImageHold.Value); break; case HoldInterval.Months: expires = forwardDate.AddMonths(_Options.ImageHold.Value); break; default: expires = forwardDate.AddYears(_Options.ImageHold.Value); break; } } if (!_Options.Verify || VerifyInstance(scp, instance.SOPInstanceUID) == DicomCommandStatusType.Success) { if (_Options.Verify) { message = string.Format("[Forwarder] SOP instance successfully verified: {0}", instance.SOPInstanceUID); Logger.Global.SystemMessage(LogType.Debug, message, _ServerAE); } forwardAgent.SetInstanceForwarded(instance.SOPInstanceUID, forwardDate, expires); } else { message = string.Format("[Forwarder] Failed to verify SOP instance: {0}. Instance not marked as forwarded.", instance.SOPInstanceUID); Logger.Global.SystemMessage(LogType.Error, message, _ServerAE); } } } catch (Exception e) { Logger.Global.SystemMessage(LogType.Error, "[Forwarder] " + e.Message, _ServerAE); } } } }
private DicomCommandStatusType SendInstance(DicomScp scp, ForwardInstance instance) { StoreScu store = null; if (_useTls && Module.IsDicomSecurityAvailable()) { store = new StoreScu(Module._Server.TemporaryDirectory, DicomNetSecurityMode.Tls, Module._openSslOptions) { AETitle = _Options.UseCustomAE ? _Options.CustomAE : _ServerAE }; Module.SetCiphers(store); } else { store = new StoreScu() { AETitle = _Options.UseCustomAE ? _Options.CustomAE : _ServerAE }; } store.Tag = DicomCommandStatusType.Failure; try { store.BeforeConnect += new BeforeConnectDelegate(BeforeConnect); store.AfterConnect += new AfterConnectDelegate(AfterConnect); store.AfterSecureLinkReady += AfterSecureLinkReady; store.BeforeAssociateRequest += new BeforeAssociationRequestDelegate(BeforeAssociateRequest); store.AfterAssociateRequest += new AfterAssociateRequestDelegate(AfterAssociateRequest); store.BeforeCStore += new BeforeCStoreDelegate(store_BeforeCStore); store.AfterCStore += new AfterCStoreDelegate(store_AfterCStore); store.BeforeReleaseRequest += new EventHandler(BeforeReleaseRequest); store.AfterReleaseRequest += new EventHandler(AfterReleaseRequest); store.Store(scp, instance.ReferencedFile); } catch (ClientAssociationException ce) { string message = string.Format("[Forwarder] Failed to establish association with server: {0}.", ce.Reason); LogEvent(LogType.Error, MessageDirection.None, message, DicomCommandType.Undefined, null, store, null); } catch (DicomException de) { string message = string.Format("[Forwarder] Error: {0}.", de.Message); LogEvent(LogType.Error, MessageDirection.Input, message, DicomCommandType.Undefined, null, store, null); } catch (Exception e) { string message = "[Forwarder] " + e.Message; Logger.Global.Log(string.Empty, string.Empty, -1, string.Empty, string.Empty, -1, DicomCommandType.Undefined, DateTime.Now, LogType.Error, MessageDirection.None, message, null, null); } finally { store.BeforeConnect -= new BeforeConnectDelegate(BeforeConnect); store.AfterConnect -= new AfterConnectDelegate(AfterConnect); store.AfterSecureLinkReady -= AfterSecureLinkReady; store.BeforeAssociateRequest -= new BeforeAssociationRequestDelegate(BeforeAssociateRequest); store.AfterAssociateRequest -= new AfterAssociateRequestDelegate(AfterAssociateRequest); store.BeforeCStore -= new BeforeCStoreDelegate(store_BeforeCStore); store.AfterCStore -= new AfterCStoreDelegate(store_AfterCStore); store.BeforeReleaseRequest -= new EventHandler(BeforeReleaseRequest); store.AfterReleaseRequest -= new EventHandler(AfterReleaseRequest); store.Dispose(); } return((DicomCommandStatusType)store.Tag); }