/// <summary> /// Removes the first occurrence of a specific <see cref="ActorConfig"/> from the <see cref="ActorConfigCollection"/>. /// </summary> /// <param name="value">The <see cref="ActorConfig"/> to remove from the <see cref="ActorConfigCollection"/>.</param> public void Remove(ActorConfig value) { List.Remove(value); }
/// <summary> /// Searches for the specified <see cref="ActorConfig"/> and /// returns the zero-based index of the first occurrence within the entire <see cref="ActorConfigCollection"/>. /// </summary> /// <param name="value">The <see cref="ActorConfig"/> to locate in the <see cref="ActorConfigCollection"/>.</param> /// <returns> /// The zero-based index of the first occurrence of value within the entire <see cref="ActorConfigCollection"/>, /// if found; otherwise, -1. /// </returns> public int IndexOf(ActorConfig value) { return(List.IndexOf(value)); }
/// <summary> /// Inserts an <see cref="ActorConfig"/> element into the <see cref="ActorConfigCollection"/> at the specified index. /// </summary> /// <param name="index">The zero-based index at which value should be inserted.</param> /// <param name="value">The <see cref="ActorConfig"/> to insert.</param> public void Insert(int index, ActorConfig value) { List.Insert(index, value); }
/// <summary> /// Determines whether the <see cref="ActorConfigCollection"/> contains a specific element. /// </summary> /// <param name="value">The <see cref="ActorConfig"/> to locate in the <see cref="ActorConfigCollection"/>.</param> /// <returns> /// <c>true</c> if the <see cref="ActorConfigCollection"/> contains the specified value; /// otherwise, <c>false</c>. /// </returns> public bool Contains(ActorConfig value) { // If value is not of type Code, this will return false. return(List.Contains(value)); }
/// <summary> /// Adds an object to the end of the <see cref="ActorConfigCollection"/>. /// </summary> /// <param name="value">The <see cref="ActorConfig"/> to be added to the end of the <see cref="ActorConfigCollection"/>.</param> /// <returns>The <see cref="ActorConfigCollection"/> index at which the value has been added.</returns> public int Add(ActorConfig value) { return(List.Add(value)); }
/// <summary> /// Adds an object to the end of the <see cref="ActorConfigCollection"/>. /// </summary> /// <param name="value">The <see cref="ActorConfig"/> to be added to the end of the <see cref="ActorConfigCollection"/>.</param> /// <returns>The <see cref="ActorConfigCollection"/> index at which the value has been added.</returns> public int Add(ActorConfig value) { return (List.Add(value)); }
/// <summary> /// Determines whether the <see cref="ActorConfigCollection"/> contains a specific element. /// </summary> /// <param name="value">The <see cref="ActorConfig"/> to locate in the <see cref="ActorConfigCollection"/>.</param> /// <returns> /// <c>true</c> if the <see cref="ActorConfigCollection"/> contains the specified value; /// otherwise, <c>false</c>. /// </returns> public bool Contains(ActorConfig value) { // If value is not of type Code, this will return false. return (List.Contains(value)); }
/// <summary> /// Searches for the specified <see cref="ActorConfig"/> and /// returns the zero-based index of the first occurrence within the entire <see cref="ActorConfigCollection"/>. /// </summary> /// <param name="value">The <see cref="ActorConfig"/> to locate in the <see cref="ActorConfigCollection"/>.</param> /// <returns> /// The zero-based index of the first occurrence of value within the entire <see cref="ActorConfigCollection"/>, /// if found; otherwise, -1. /// </returns> public int IndexOf(ActorConfig value) { return (List.IndexOf(value)); }
/// <summary> /// Copies the elements of the <see cref="ICollection"/> to a strong-typed <c>ActorConfig[]</c>, /// starting at a particular <c>ActorConfig[]</c> index. /// </summary> /// <param name="array"> /// The one-dimensional <c>ActorConfig[]</c> that is the destination of the elements /// copied from <see cref="ICollection"/>. /// The <c>ActorConfig[]</c> must have zero-based indexing. /// </param> /// <param name="index"> /// The zero-based index in array at which copying begins. /// </param> /// <remarks> /// Provides the strongly typed member for <see cref="ICollection"/>. /// </remarks> public void CopyTo(ActorConfig[] array, int index) { ((ICollection)this).CopyTo(array, index); }
/// <summary> /// Load the Actor Configuration into the Integration Profile. /// </summary> /// <param name="configurationFilename">Configuration Filename</param> public void Load(System.String configurationFilename) { _actorConfigCollection = new ActorConfigCollection(); _peerToPeerConfigCollection = new BasePeerToPeerConfigCollection(); try { XmlTextReader reader = new XmlTextReader(configurationFilename); while (reader.EOF == false) { reader.ReadStartElement("IheIntegrationProfile"); _profileName = reader.ReadElementString("IntegrationProfileName"); _commonConfig.RootedBaseDirectory = reader.ReadElementString("RootedBaseDirectory"); _commonConfig.ResultsDirectory = reader.ReadElementString("ResultsDirectory"); // read OverwriteResults - added later - some config files may not contain this parameter reader.ReadString(); if (reader.Name == "OverwriteResults") { System.String overwriteResults = reader.ReadElementString("OverwriteResults"); if (overwriteResults == "True") { _commonConfig.OverwriteResults = true; } else { _commonConfig.OverwriteResults = false; } } _commonConfig.CredentialsFilename = reader.ReadElementString("CredentialsFilename"); _commonConfig.CertificateFilename = reader.ReadElementString("CertificateFilename"); _commonConfig.NistWebServiceUrl = reader.ReadElementString("NistWebServiceUrl"); _commonConfig.Hl7ProfileDirectory = reader.ReadElementString("Hl7ProfileDirectory"); _commonConfig.Hl7ProfileStoreName = reader.ReadElementString("Hl7ProfileStoreName"); _commonConfig.Hl7ValidationContextFilename = reader.ReadElementString("Hl7ValidationContextFilename"); System.String interactive = reader.ReadElementString("Interactive"); if (interactive == "True") { _commonConfig.Interactive = true; } else { _commonConfig.Interactive = false; } while ((reader.IsStartElement()) && (reader.Name == "ActorConfiguration")) { reader.ReadStartElement("ActorConfiguration"); reader.ReadStartElement("ActorName"); ActorTypeEnum actorType = ActorTypes.TypeEnum(reader.ReadElementString("ActorType")); System.String id = reader.ReadElementString("ActorId"); ActorName actorName = new ActorName(actorType, id); reader.ReadEndElement(); ActorConfigStateEnum configState = ActorConfigState.ConfigStateEnum(reader.ReadElementString("ConfigState")); ActorConfig actorConfig = new ActorConfig(actorName, configState); _actorConfigCollection.Add(actorConfig); reader.ReadEndElement(); } while ((reader.IsStartElement()) && ((reader.Name == "DicomPeerToPeerConfiguration") || (reader.Name == "Hl7PeerToPeerConfiguration"))) { if (reader.Name == "DicomPeerToPeerConfiguration") { DicomPeerToPeerConfig dicomPeerToPeerConfig = new DicomPeerToPeerConfig(); reader.ReadStartElement("DicomPeerToPeerConfiguration"); reader.ReadStartElement("FromActor"); reader.ReadStartElement("ActorName"); ActorTypeEnum actorType = ActorTypes.TypeEnum(reader.ReadElementString("ActorType")); System.String id = reader.ReadElementString("ActorId"); ActorName actorName = new ActorName(actorType, id); dicomPeerToPeerConfig.FromActorName = actorName; reader.ReadEndElement(); dicomPeerToPeerConfig.FromActorAeTitle = reader.ReadElementString("AeTitle"); reader.ReadEndElement(); reader.ReadStartElement("ToActor"); reader.ReadStartElement("ActorName"); actorType = ActorTypes.TypeEnum(reader.ReadElementString("ActorType")); id = reader.ReadElementString("ActorId"); actorName = new ActorName(actorType, id); dicomPeerToPeerConfig.ToActorName = actorName; reader.ReadEndElement(); dicomPeerToPeerConfig.ToActorAeTitle = reader.ReadElementString("AeTitle"); dicomPeerToPeerConfig.ToActorIpAddress = reader.ReadElementString("IpAddress"); reader.ReadEndElement(); dicomPeerToPeerConfig.PortNumber = UInt16.Parse(reader.ReadElementString("PortNumber")); System.String secureConnection = reader.ReadElementString("SecureConnection"); if (secureConnection == "True") { dicomPeerToPeerConfig.SecureConnection = true; } else { dicomPeerToPeerConfig.SecureConnection = false; } // read AutoValidate - added later - some config files may not contain this parameter reader.ReadString(); if (reader.Name == "AutoValidate") { System.String autoValidate = reader.ReadElementString("AutoValidate"); if (autoValidate == "True") { dicomPeerToPeerConfig.AutoValidate = true; } else { dicomPeerToPeerConfig.AutoValidate = false; } } dicomPeerToPeerConfig.ActorOption1 = reader.ReadElementString("ActorOption1"); dicomPeerToPeerConfig.ActorOption2 = reader.ReadElementString("ActorOption2"); dicomPeerToPeerConfig.ActorOption3 = reader.ReadElementString("ActorOption3"); dicomPeerToPeerConfig.SessionId = UInt16.Parse(reader.ReadElementString("SessionId")); dicomPeerToPeerConfig.SourceDataDirectory = reader.ReadElementString("SourceDataDirectory"); dicomPeerToPeerConfig.StoreDataDirectory = reader.ReadElementString("StoreDataDirectory"); System.String storeData = reader.ReadElementString("StoreData"); if (storeData == "True") { dicomPeerToPeerConfig.StoreData = true; } else { dicomPeerToPeerConfig.StoreData = false; } reader.ReadStartElement("DefinitionFiles"); bool readingDefinitionFiles = true; while (readingDefinitionFiles == true) { dicomPeerToPeerConfig.AddDefinitionFile(reader.ReadElementString("DefinitionFile")); reader.Read(); if ((reader.NodeType == XmlNodeType.EndElement) && (reader.Name == "DefinitionFiles")) { reader.Read(); readingDefinitionFiles = false; } } _peerToPeerConfigCollection.Add(dicomPeerToPeerConfig); reader.ReadEndElement(); } else { Hl7PeerToPeerConfig hl7PeerToPeerConfig = new Hl7PeerToPeerConfig(); reader.ReadStartElement("Hl7PeerToPeerConfiguration"); reader.ReadStartElement("FromActor"); reader.ReadStartElement("ActorName"); ActorTypeEnum actorType = ActorTypes.TypeEnum(reader.ReadElementString("ActorType")); System.String id = reader.ReadElementString("ActorId"); ActorName actorName = new ActorName(actorType, id); hl7PeerToPeerConfig.FromActorName = actorName; reader.ReadEndElement(); hl7PeerToPeerConfig.FromActorAeTitle = reader.ReadElementString("AeTitle"); reader.ReadEndElement(); reader.ReadStartElement("ToActor"); reader.ReadStartElement("ActorName"); actorType = ActorTypes.TypeEnum(reader.ReadElementString("ActorType")); id = reader.ReadElementString("ActorId"); actorName = new ActorName(actorType, id); hl7PeerToPeerConfig.ToActorName = actorName; reader.ReadEndElement(); hl7PeerToPeerConfig.ToActorAeTitle = reader.ReadElementString("AeTitle"); hl7PeerToPeerConfig.ToActorIpAddress = reader.ReadElementString("IpAddress"); reader.ReadEndElement(); hl7PeerToPeerConfig.PortNumber = UInt16.Parse(reader.ReadElementString("PortNumber")); hl7PeerToPeerConfig.MessageDelimiters.FromString(reader.ReadElementString("MessageDelimiters")); System.String secureConnection = reader.ReadElementString("SecureConnection"); if (secureConnection == "True") { hl7PeerToPeerConfig.SecureConnection = true; } else { hl7PeerToPeerConfig.SecureConnection = false; } // read AutoValidate - added later - some config files may not contain this parameter reader.ReadString(); if (reader.Name == "AutoValidate") { System.String autoValidate = reader.ReadElementString("AutoValidate"); if (autoValidate == "True") { hl7PeerToPeerConfig.AutoValidate = true; } else { hl7PeerToPeerConfig.AutoValidate = false; } } hl7PeerToPeerConfig.ActorOption1 = reader.ReadElementString("ActorOption1"); hl7PeerToPeerConfig.ActorOption2 = reader.ReadElementString("ActorOption2"); hl7PeerToPeerConfig.ActorOption3 = reader.ReadElementString("ActorOption3"); hl7PeerToPeerConfig.SessionId = UInt16.Parse(reader.ReadElementString("SessionId")); _peerToPeerConfigCollection.Add(hl7PeerToPeerConfig); reader.ReadEndElement(); } } reader.ReadEndElement(); } reader.Close(); } catch (System.Exception e) { System.String message = System.String.Format("Failed to read configuration file: \"{0}\". Error: \"{1}\"", configurationFilename, e.Message); throw new System.SystemException(message, e); } }