Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Assemblers/Geometry2DSectionAssembler.cs =================================================================== diff -u -r3522 -r3859 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Assemblers/Geometry2DSectionAssembler.cs (.../Geometry2DSectionAssembler.cs) (revision 3522) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Assemblers/Geometry2DSectionAssembler.cs (.../Geometry2DSectionAssembler.cs) (revision 3859) @@ -53,19 +53,19 @@ { } - public override XDocument CreateDataTransferObject(Geometry2DSectionParameters geometry2DSectionParameters) + public override XDocument CreateDataTransferObject(Geometry2DSectionParameters dtoObject) { - var doc = base.CreateDataTransferObject(geometry2DSectionParameters); + var doc = base.CreateDataTransferObject(dtoObject); XNamespace tns = ElementNamespace; // Geometry2DSectionParameters - XElement geometry2DSectionElement = GetGeometry2DSectionParametersElement(geometry2DSectionParameters, tns); + XElement geometry2DSectionElement = GetGeometry2DSectionParametersElement(dtoObject, tns); if (doc.Root != null) { doc.Root.Add(geometry2DSectionElement); // Profile - var profile = geometry2DSectionParameters.SoilProfile; + var profile = dtoObject.SoilProfile; if (profile != null) { var soilProfileAssembler = new SoilProfileAssembler(); @@ -151,11 +151,11 @@ } } - public override Geometry2DSectionParameters CreateOutputObject(XDocument dtoDocument) + public override Geometry2DSectionParameters CreateOutputObject(XDocument dtoObject) { Geometry2DSectionParameters geometry2DSectionParameters = new Geometry2DSectionParameters(); // Get the dto - XElement dto = (from x in dtoDocument.Descendants() + XElement dto = (from x in dtoObject.Descendants() where x.Name.LocalName == XmlElementGeometry2DSectionInput select x).FirstOrDefault(); if (dto != null) @@ -165,7 +165,7 @@ } // Get the dto - XElement profileDto = (from x in dtoDocument.Descendants() + XElement profileDto = (from x in dtoObject.Descendants() where x.Name.LocalName == XMLAttributes.XmlElementProfile select x).FirstOrDefault(); if (profileDto != null) Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Assemblers/DtoDocumentAssembler.cs =================================================================== diff -u -r3522 -r3859 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Assemblers/DtoDocumentAssembler.cs (.../DtoDocumentAssembler.cs) (revision 3522) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Assemblers/DtoDocumentAssembler.cs (.../DtoDocumentAssembler.cs) (revision 3859) @@ -27,13 +27,12 @@ namespace Deltares.DamEngine.Calculators.KernelWrappers.Assemblers { /// - /// Default implementation for the interface + /// Default implementation for the interface /// /// - /// This base class inherits from this class just fixes + /// This base class inherits from this class just fixes /// the dto type to XElement /// - /// The domain object type public abstract class DtoDocumentAssembler : IDtoAssembler where TDomainInputObject : new() where TDomainOutputObject : new() @@ -44,7 +43,7 @@ /// Sets the element name /// The text reader stream for reading in ther xsd file which is embedded as an resource public DtoDocumentAssembler(string elementName, string elementNamespace, string embeddedXsdPath) - : this(elementName, elementNamespace, embeddedXsdPath, null, null) + : this(elementName, elementNamespace, null, null) { } @@ -53,19 +52,20 @@ /// /// Sets the element name /// The text reader stream for reading in ther xsd file which is embedded as an resource - public DtoDocumentAssembler(string elementName, string elementNamespace, string embeddedXsdPath, - DtoAssembler inputAssembler, DtoAssembler outputAssembler) + public DtoDocumentAssembler(string elementName, string elementNamespace, + DtoAssembler inputAssembler, + DtoAssembler outputAssembler) { if (elementName == null) throw new ArgumentNullException("elementName"); if (elementNamespace == null) throw new ArgumentNullException("elementNamespace"); - this.ElementName = elementName; - this.ElementNamespace = elementNamespace; - this.OutputAssembler = outputAssembler; - this.InputAssembler = inputAssembler; + ElementName = elementName; + ElementNamespace = elementNamespace; + OutputAssembler = outputAssembler; + InputAssembler = inputAssembler; //Stream xsdStream = Common.GetEmbeddedFile(Assembly.GetExecutingAssembly(), embeddedXsdPath); //this.Schema = XDocument.Load(new StreamReader(xsdStream)); } @@ -97,43 +97,43 @@ #region IDtoAssembler Members - public virtual TDomainOutputObject CreateOutputObject(XDocument dtoDocument) + public virtual TDomainOutputObject CreateOutputObject(XDocument dtoObject) { - if (dtoDocument == null) - throw new ArgumentNullException("dtoDocument"); + if (dtoObject == null) + throw new ArgumentNullException("dtoObject"); - if (this.OutputAssembler != null) + if (OutputAssembler != null) { // the document should contain the element only once! - XElement el = (from x in dtoDocument.Descendants() - where x.Name.LocalName == this.OutputAssembler.ElementName + XElement el = (from x in dtoObject.Descendants() + where x.Name.LocalName == OutputAssembler.ElementName select x).Single(); - return this.OutputAssembler.CreateDomainObject(el); + return OutputAssembler.CreateDomainObject(el); } return default(TDomainOutputObject); } - public virtual TDomainInputObject CreateInputObject(XDocument dtoDocument) + public virtual TDomainInputObject CreateInputObject(XDocument dtoObject) { - if (dtoDocument == null) - throw new ArgumentNullException("dtoDocument"); + if (dtoObject == null) + throw new ArgumentNullException("dtoObject"); - if (this.InputAssembler != null) + if (InputAssembler != null) { // the document should contain the element only once! - XElement el = (from x in dtoDocument.Descendants() - where x.Name.LocalName == this.InputAssembler.ElementName + XElement el = (from x in dtoObject.Descendants() + where x.Name.LocalName == InputAssembler.ElementName select x).Single(); - return this.InputAssembler.CreateDomainObject(el); + return InputAssembler.CreateDomainObject(el); } return default(TDomainInputObject); } - public virtual XDocument CreateDataTransferObject(TDomainInputObject domainInputObj) + public virtual XDocument CreateDataTransferObject(TDomainInputObject dtoObject) { var doc = new XDocument(new XDeclaration("1.0", "utf-8", "yes")); @@ -143,22 +143,22 @@ XNamespace xsi = "http://www.w3.org/2001/XMLSchema-instance"; - XNamespace tns = this.ElementNamespace; + XNamespace tns = ElementNamespace; XNamespace tns1 = fileIdAssembler.ElementNamespace; - var root = new XElement(tns + this.ElementName, + var root = new XElement(tns + ElementName, new XAttribute(XNamespace.Xmlns + "xsi", xsi.NamespaceName), new XAttribute(XNamespace.Xmlns + "tns", tns.NamespaceName), new XAttribute(XNamespace.Xmlns + "tns1", tns1.NamespaceName)); doc.Add(root); doc.Root.Add(fileId.ToDto(fileIdAssembler, tns)); - if (this.InputAssembler != null) + if (InputAssembler != null) { - XNamespace tns2 = this.InputAssembler.ElementNamespace; + XNamespace tns2 = InputAssembler.ElementNamespace; root.Add(new XAttribute(XNamespace.Xmlns + "tns2", tns2.NamespaceName)); - doc.Root.Add(domainInputObj.ToDto(this.InputAssembler, tns)); + doc.Root.Add(dtoObject.ToDto(InputAssembler, tns)); } return doc; @@ -168,12 +168,12 @@ public TDomainOutputObject CreateOutputObject(string fileName) { - return this.CreateOutputObject(this.CreateDocument(fileName)); + return CreateOutputObject(CreateDocument(fileName)); } public TDomainInputObject CreateInputObject(string fileName) { - return this.CreateInputObject(this.CreateDocument(fileName)); + return CreateInputObject(CreateDocument(fileName)); } private XDocument CreateDocument(string fileName) Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Assemblers/IDtoAssembler.cs =================================================================== diff -u -r3522 -r3859 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Assemblers/IDtoAssembler.cs (.../IDtoAssembler.cs) (revision 3522) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Assemblers/IDtoAssembler.cs (.../IDtoAssembler.cs) (revision 3859) @@ -55,33 +55,33 @@ /// to be created from a dto and vice versa. /// The dto in this case can be any class. /// - /// The domain object type + /// The input domain object type + /// The domain object type /// The dto object type public interface IDtoAssembler { /// /// Creates a domain object from output dto /// - /// The dto to create a domain object from + /// The dto to create a domain object from /// The domain object - TDomainOutputObject CreateOutputObject(TDataTransferObject dto); + TDomainOutputObject CreateOutputObject(TDataTransferObject dtoObject); /// /// Creates a domain object from output dto /// - /// The dto to create a domain object from + /// The dto to create a domain object from /// The domain object - TDomainInputObject CreateInputObject(TDataTransferObject dto); + TDomainInputObject CreateInputObject(TDataTransferObject dtoObject); /// /// Creates a dto from a domain input object /// - /// The domain object to create the dto from + /// The domain object to create the dto from /// The dto object - TDataTransferObject CreateDataTransferObject(TDomainInputObject input); + TDataTransferObject CreateDataTransferObject(TDomainInputObject dtoObject); } - /// /// Defines the contract of a data transfer object (dto) assembler /// The interface should be used in scenario's where an domain object needs