/// <summary> /// Creates EDRMManager object with eDRMfile at specified location /// </summary> /// <param name="eDRMFile">EDRM file location on disk</param> public EDRMManager(string eDRMFile) { try { // Make source path usable in C# code. sourcePath = eDRMFile.Replace("/", @"\"); // EDRM file name edrmFileName = sourcePath.Substring(sourcePath.LastIndexOf(@"\", StringComparison.Ordinal)); // Set the source path. Folder in which the EDRM file exists sourcePath = sourcePath.Substring(0, sourcePath.LastIndexOf(@"\", StringComparison.Ordinal)); // Deserialize EDRM XML //_EDRMEntity = (EDRMEntity)(new XmlSerializer(typeof(EDRMEntity)).Deserialize(new StreamReader(eDRMFile))); edrmEntity = new EdrmXmlDeserializer().DeserializeEdrmXml(eDRMFile); if (edrmEntity.BatchEntity != null) { if (edrmEntity.BatchEntity.Relationships != null) { relationships = edrmEntity.BatchEntity.Relationships; } } } catch (Exception ex) { // This is not an exception caught in superficial layers. So EVException and error code need to be used. Tracer.Error(string.Format("{0}:{1}", "EDRM Manager", ex.ToDebugString())); ex.AddUsrMsg("EDRM Manager object couldn't be created. "); throw; } }
/// <summary> /// Initializes a new instance of the <see cref="EdrmXmlDeserializer"/> class. /// </summary> public EdrmXmlDeserializer() { edrmEntity = new EDRMEntity { BatchEntity = new BatchEntity() }; }